关于题意:如果走L形的move,我们不认为它经过任何其他的格子。
本题是典型的DFS。我们从任意点开始,每个回合有16种移动的选择:上、下、左、右、左上、左下、右上、右下、左上上、右上上、左下下、右下下、左左上、左左下、右右上、右右下。
特别地,对于前8种move而言,如果走一步遇到的格子是已经访问过的,根据规则,可以再朝同方向走一步(算作同一次操作)。如果走一步遇到的格子是没有访问过的,则不能这么做。
GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — LeetCode/DFS/351.Android-Unlock-Patterns at master · wisdompeak/LeetCode Expand file tree/ Copy path351.Android-Unlock-Patterns/Directory actionsMore optionsMore optionsDirectory actionsMore optionsMore options/ Copy path351.Android-Unlock-Patterns/Folders and files
| |||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | |||||||||||||||||||||