__________________________________________________

**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:

- 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 three elements in an array that sum to a given value
- Find three elements in an array that sum to a zero.
- Find the two repeating elements in a given array | 6 Approaches
- Find the only element in array which appears only once
- Maximum difference between two elements where larger element appears after the smaller…
- Sliding Window Algorithm (Track the maximum of each subarray of size k)
- Find two non-repeating numbers in an array in O(n) time and O(1) space
- Count and print all Subarrays with product less than K in O(n)