mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 12:14:26 +08:00
规范格式
This commit is contained in:
@ -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
|
||||
}
|
Reference in New Issue
Block a user