规范格式

This commit is contained in:
YDZ
2020-08-07 15:50:06 +08:00
parent 854a339abc
commit 4e11f4028a
1438 changed files with 907 additions and 924 deletions

View File

@ -0,0 +1,18 @@
package leetcode
import "strings"
func uncommonFromSentences(A string, B string) []string {
m, res := map[string]int{}, []string{}
for _, s := range []string{A, B} {
for _, word := range strings.Split(s, " ") {
m[word]++
}
}
for key := range m {
if m[key] == 1 {
res = append(res, key)
}
}
return res
}