Problem Given the list of numbers, find the local min or local max Local max or min is the number that exists between the first and last number. For example, 1 , 2 , 3 , 4 , 3 , 2 => local max exists, which is 4 1 , 2 , 3 , 4 , 5 , 6 , 7 => No local max or local min exists 5 , 4 , 3 , 2 , 1 => No local max or local min exists 9 , 8 , 7 , 6 , 5 , 6 , 7 , 8 , 9 => local min exists, which is 5. Challenging part is that your problem should run faster than O(N).