Leetcode 752.打开转盘锁 C语言
很明显的状态转移问题,这类问题利用bfs求最短路径都能得到有效的解决,基本都是体力活了。
思考一:如何判断死亡数字
Solution: 很简单的问题,但是为了提高效率一定要对deadends去重。
bool unlocked(char** deadends,int deadendsSize,char* s){
int i;
for(i = 0 ; i < deadendsS...
原创
2019-03-31 13:19:05 ·
474 阅读 ·
0 评论