problem
solution
1 | class Solution { |
option 2 - in-place modify
1 | class Solution { |
option 3 - follow up
1 | class Solution { |
analysis
- time complexity
O(nm)
- space complexity
O(nm)
O(1)
in-placeO(n)
1 | class Solution { |
1 | class Solution { |
1 | class Solution { |
O(nm)
O(nm)
O(1)
in-place O(n)