You are viewing a single comment's thread. Return to all comments →
Sorting is O(N log N); you should be fine. Consider 10^5 elements in the list and 10^5 queries; what's the time complexity of your solution?
Subset Sum
You are viewing a single comment's thread. Return to all comments →
Sorting is O(N log N); you should be fine. Consider 10^5 elements in the list and 10^5 queries; what's the time complexity of your solution?