Get the latest tech news
Interview Coder is an invisible AI for technical interviews
-recording softwares. Undetectability may not work with some versions of MacOS.
The current solution uses nested loops, resulting in O(n²) time complexity. We can optimize this by using a hash map to store previously seen numbers. This reduces time complexity to O(n) with O(n) space trade-off.
Or read this on Hacker News