Short Problem Definition:
You are given N sticks, where each stick has the length of a positive integer. A cut operation is performed on the sticks such that all of them are reduced by the length of the smallest stick.
time complexity is O(n*log(n))
space complexity is O(n)
Cutting every stick will result in O(N^2) which is not required. Sorting the array requires nlogn time. Python pop() requires O(1) time and importantly it does not rearrange or reallocate the array.
With each step, remove all elements from the list (actually a stack/queue) that have the same value and print the size of the remaining list.