找出字符串中第一个不重复的字符
我的解决方法
- 将字符串转换成字符数组
- 使用两层循环遍历,最终根据第二层循环退出时的下标值来判断是否是不重复的字符
我的代码:
public int firstUniqChar(String s) {
char[] temp = s.toCharArray();
int length = temp.length;
int j,i;
int result =0;
for(i=