Amazon Interview Question
Country: United States
I think we should sort the numbers, then for each i we can do a binary search for array[i]×10.. if we found a match then we have a pair a,b.. if no match was found our modified binary search should return the largest number smaller than array[i]×10.. if that number is not the array[i] then a match is found.. else do the same for the next array elements
- Krzysztof.G October 16, 2013