bucket of size 101 to store the frequency of each number in the current window.result to store the beauty of each subarray.bucket with the frequencies of the first k numbers in nums.i to i + k - 1:
a. If it's the first window, calculate the beauty and store it in result.
b. For subsequent windows, decrement the frequency of the outgoing number and increment the frequency of the incoming number.
c. Calculate the beauty of the current window by iterating over the bucket array and finding the xth smallest negative number.result array.