规范格式

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,14 @@
package leetcode
func firstUniqChar(s string) int {
result := make([]int, 26)
for i := 0; i < len(s); i++ {
result[s[i]-'a']++
}
for i := 0; i < len(s); i++ {
if result[s[i]-'a'] == 1 {
return i
}
}
return -1
}