Find out the duplicate element in O(logN) time
Given an array consisting of integers in range 1 to n consisting of only one duplicate element. Find out the duplicate element in O(logN) time. Examples: Input : 6 1 1 2 3 4 5 Output : 1 Input : 5 1 2 3 4 4 Output : 4 Using Binary Search: Time Complexity: O(logN)
