Skip to content

Commit c3dfd2d

Browse files
authored
Merge pull request gzc426#177 from fsd2018/patch-3
Create 铁男神sama.md
2 parents f898e1e + ed4d273 commit c3dfd2d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
#
3+
4+
```
5+
class Solution {
6+
public int firstUniqChar(String s) {
7+
int[] array=new int[26];
8+
for(char c:s.toCharArray()){
9+
array[c-'a']+=1;
10+
}
11+
for(char c:s.toCharArray()){
12+
if(array[c-'a']==1)return s.indexOf(c);
13+
}
14+
return -1;
15+
}
16+
}
17+
```
18+
19+
#
20+

0 commit comments

Comments
 (0)