Mean:
略
analyse:
记录所有空位置,判断当前空位置是否可以填某个数,然后直接DFS,注意从后往前搜索,时间比正向搜快很多。16ms水过
Time complexity: O(n)
Source code:

View Code
Mean:
略
analyse:
记录所有空位置,判断当前空位置是否可以填某个数,然后直接DFS,注意从后往前搜索,时间比正向搜快很多。16ms水过
Time complexity: O(n)
Source code:
View Code