problem
solution
option 1 - cheat merge sort
1 | class Solution { |
option 2 - *Binary Search
1 | class Solution { |
analysis
- option 1
- time complexity
O(n+m)
- space complexity
O(n+m)
- time complexity
- option 2
- time complexity
O(log(m+n))
- space complexity
O(1)
- time complexity