We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Since we are guaranteed that each number is unique, we can use a structure with constant-time contains() and solve the problem in linear time, am I wrong? At least my solution passed all test cases.
Pairs
You are viewing a single comment's thread. Return to all comments →
Since we are guaranteed that each number is unique, we can use a structure with constant-time contains() and solve the problem in linear time, am I wrong? At least my solution passed all test cases.