Source : Microsoft Interview Question
Given a sorted array, in which every element is present twice except one which is present single time
Do a binary "search" (rather traversal) on the array, check both neighbors, if both are different from the value in the middle, you have the solution. This is O(log n).
O(log n)