← Infosys questions
CodingEasy

Find number of index pairs based on GET function

Filed under Infosys

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.

Related Infosys questions

Collected from public candidate posts and coding forums. Updated Nov 2026.