C++回遡與bitmask解Leetcode 37數獨Sudoku
有些經典問題值得一解再解,雖然不是最佳解,也要比Leetcode Editorial的解有效許多。解數獨,回遡乃基本款,但加上bitmask就能篩掉許多無用的測試,就更快許多
-----
Some classic problems are worth solving again and again. Although they are not the best solutions, they are much more effective than Leetcode Editorial's solutions. Solve Sudoku by using backtracking is the basic version, but add bitmask to filter out many useless tests can make it much faster.
[codes on Leetcode]https://leetcode.com/problems/sudoku-solver/solutions/7139967/new-sol-bitmask-backtracking-beats-100/
[其他採回溯未用bitmask解法]https://www.youtube.com/watch?v=wviWrbbOdYE