Can someone give me a small explanation of what is being done in the proposed solution? Thanks.
i guess we start for end , and try making buckets, we add an element to a bucket is top is smaller than arr[i] , else we make a new bucket, we can easily find the required bucket using binary search.
How can we use binary search here if the arrays are not sorted? Also, could we get more explanation about how they went from the problem statement to using a this bisect method?