We only need to make sure that the board is valid. The worst case is O(n^2) and we will surely come up with a better solution.
Solution 1: accepted
Space for speed.
|
|
We only need to make sure that the board is valid. The worst case is O(n^2) and we will surely come up with a better solution.
Space for speed.
|
|