problem
solution
option 1 - dfs
1 | class Solution { |
option 2 - bfs
1 | class Solution { |
analysis
- option 1 - dfs
- time complexity
O(n*m)
- space complexity
O(n*m)
- time complexity
- option 2 - bfs
- time complexity
O(n*m)
- space complexity
O(n*m)
- time complexity