problem
solution
need four variable , reprsentation
- the number of visited zero
- the number of unvisited zero
- the number of visited one
- the number of unvisited one
1 | class Solution { |
analysis
- time complexity
O(n)
- space complexity
O(1)
need four variable , reprsentation
1 | class Solution { |
O(n)
O(1)