Microsoft | Onsite | Redmond
Anonymous User
2199

Given an unsorted integer array find the indices of the two integers such that Arr[j] > Arr[i] and i< j. Can someone provide a solution for this in java ?

Input : {7,9,5,6,3,2}
Output: 2

Input: {Integer.MIN_VALUE, Integer.MAX_VALUE}
This was an edge case I missed and the interviewer did not say what the output of this input will be.

Comments (7)