Skip to content

Commit 4983753

Browse files
authored
Update Readme.md
1 parent a8d03ad commit 4983753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
### 408.Valid-Word-Abbreviation
22

3-
思路非常直接,遍历一遍abbr,移动abbr的同时也移动word的指针,看看每一步都是否对应。
3+
典型的双指针。遍历一遍abbr,移动abbr的指针的同时,也相应地移动word的指针,看看每一步都是否对应。具体地说,就是abbr的字母和word字母对应,abbr的数字和word里相同数目的字母对应
44

55
需要注意的细节:
66
1. 数字不能有前导0. 比如word=ab, abbr=02就应该输出false.
77
2. abbr遍历完之后,word的遍历也应该恰好结束。即if (i!=word.size()) return false;
88

99

10-
[Leetcode Link](https://leetcode.com/problems/valid-word-abbreviation)
10+
[Leetcode Link](https://leetcode.com/problems/valid-word-abbreviation)

0 commit comments

Comments
 (0)