Challenges • Asked over 4 years ago by Anonymous
Stritcly speaking ins't the hasmap solution also O(1) space complexity? The unique values in the array are the numbers base 10 so there are only max 10 entries in the map. Space complexity of O(10) is the same as O(1) as it doesn't vary with the length of the input.
Link to problem: Lonely Number.