__________________________________________________

**Top Companies Interview Questions..-**

Microsoft | Amazon | more.. |

If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.

__________________________________________________

### Related Posts:

- Find the two repeating elements in a given array | 6 Approaches
- Find the only element in array which appears only once
- Find two non-repeating numbers in an array in O(n) time and O(1) space
- Divide and Conquer – Rearrange array elements in special order
- All elements appears thrice and one element appears once. Find that element in O(n) time…
- Find duplicates in an given array in O(n) time and O(1) extra space.
- Find three elements in an array that sum to a given value
- Find three elements in an array that sum to a zero.
- Sliding Window Algorithm (Track the maximum of each subarray of size k)
- Maximum difference between two elements where larger element appears after the smaller…