Day 25 of June LeetCode Challenge

Input: [1,3,4,2,2]
Output: 2
Input: [3,1,3,4,2]
Output: 3
  1. You must not modify the array (assume the array is read only).
  2. You must use only constant, O(1) extra space.
  3. Your runtime complexity should be less than O(n2).
  4. There is only one duplicate number in the array, but it could be repeated more than once.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aanchal Patial

Aanchal Patial

13 Followers

We never really grow up, we only learn how to act in public