This should be a simple problem. But I\'m not supposed to use the O(n^2). ``input = 1, 1, 3, 6,8 output = 3 if it\'s 2 instead of 3 at input[2] , the output is 2.