Skip to content

Commit d4b6597

Browse files
authored
Create 张小胖.md
1 parent 97c4cce commit d4b6597

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

2018.12.1-leetcode387/张小胖.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//参考了大佬的..
2+
class Solution {
3+
public:
4+
int firstUniqChar(string s) {
5+
vector<int> number(26);
6+
int i;
7+
for(i=0;i<s.size();i++)
8+
number[s[i]-'a']++; //录入重复的个数
9+
for(i=0;i<s.size();i++)
10+
if(number[s[i]-'a']==1) //检验
11+
return i;
12+
return -1;
13+
}
14+
};

0 commit comments

Comments
 (0)