Skip to content

Commit

Permalink
Create Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored May 8, 2021
1 parent bda9ff6 commit 3995e21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DFS/291.Word-Pattern-II/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### 291.Word-Pattern-II

建立两个映射,Map1从pattern的字符指向str的字符串,Map2建议相反的映射。DFS的每个回合,尝试将pattern的一个字符与str的一个前缀配对起来。校验如果这个配对已经存在,那么就递归处理pattern和str的剩余部分。如果这个配对不存在,就创建这个配对,分别更新Map1和Map2,然后同样递归处理.

注意这题需要回溯,即每次返回前需要清理Map1和Map2最新添加的元素。

0 comments on commit 3995e21

Please sign in to comment.