Skip to content

Commit fa2c679

Browse files
JackieHooJackieHoo
JackieHoo
authored and
JackieHoo
committedFeb 3, 2020
add
1 parent 407fdbc commit fa2c679

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
 

‎242.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Valid Anagram
2+
### 解法一
3+
```go
4+
//使用一个辅助哈希表的方式
5+
func isAnagram(s string, t string) bool {
6+
result := make(map[rune]int) // 设置一个储存数据。
7+
8+
for _,v := range s {
9+
result[v]++
10+
}
11+
for _,v := range t {
12+
result[v]--
13+
14+
}
15+
16+
for _,v := range result {
17+
if v != 0 {
18+
return false
19+
}
20+
}
21+
return true
22+
}
23+
```

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All leetcode questions that solved in different methods.
55
|question number|URL|type|result|
66
|:---:|:---:|:---:|:---:|
77
|[240](./240.md)|[Search a 2D Matrix II](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/description/)|array|👌|
8+
|[242](./242.md)|[Valid Anagram](https://leetcode-cn.com/problems/valid-anagram/description/)|string|👌|
89
|[283](./283.md)|[Move Zeroes](https://leetcode-cn.com/problems/move-zeroes/description/)|array|👌|
910
|[287](./287.md)|[Find the Duplicate Number](https://leetcode-cn.com/problems/find-the-duplicate-number/description/)|array|👌|
1011
|[378](./378.md)|[Kth Smallest Element in a Sorted Matrix](https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/description/)|array|👌|

0 commit comments

Comments
 (0)
Please sign in to comment.