answer means-- number of elements to its right such that they are greater than this element → Reply X-OR 11 months ago, # | 0 I guess you are trying to find count of inversions in array which is if i < j and a[i] > a[j] This can be done using merge sort along with...
Unique Element Collection: The first step is to identify unique elements in the array. This is done using a set sty and a stack st. The stack st is used to store indices of unique elements in reverse order (from the end of the array to the beginning). The stack is used because when...
Is it possible to locate the max or min value in a range of indices l,r in an array for q queries?? lets say we have an array a of length n. we are given q queries with indices l,r. we have to locate the position of minimum or maximum value within that range...of l,r. t...