Minimum Number of Decreasing Subsequence Partitions - Company-specific OAs / Google OA

https://algo.monster/problems/google_oa_min_decreasing_partitions

1 Like

Can someone give me a small explanation of what is being done in the proposed solution? Thanks.

1 Like

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?