problem
solution
option 1 - STL to store
1 | class Solution { |
option 2 - heap
1 | class Solution { |
option 3- Binary Search
1 | class Solution { |
analysis
- option 1
- time complexity
O(n^2)
- space
O(n)
- time complexity
- option 2
- time complexity
O(n^2)
- space complexity
O(n)
- time complexity