Given an array of n integers, find the number of index pairs (l, r) that maximize GET(l, r). GET(l, r) is 0 if min(arr[l], arr[r]) <= max(arr[l+1...r-1]). Otherwise, it is min(arr[l], arr[r])^2 * (r…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.