You are viewing a single comment's thread. Return to all comments →
Your code has complexity O(n^2) -- It should be at least O(n * logn) to not time out. Its possible to solve it in O(n)
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
Your code has complexity O(n^2) -- It should be at least O(n * logn) to not time out. Its possible to solve it in O(n)