Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.
给一个字符串,返回第一个不重复的字符的index,要是没有的话就返回-1
//第一次做,感觉巨简单,设一个set,一旦contains,就用striing.indexOf()---------还能用上不熟悉的函数,简直完美
//但是返回的是!!第一个重复的字符啊!!
//又考虑用map,but还是不行啊,就算 value=0的是不重复的,那不知道哪个是第一个啊啊啊啊
没再继续想下去,【好像很容易把问题想复杂,明明用桶就可以啊】26个桶,index用字符表示
【0--48,a--97】其实都不用,因为a想要对应0就index=c-'a'就可以了啊
//0316复习,看题再次蒙,两点:判断重复或者不重复,数量少----桶排序,index的问题也没想起来,
//0330重做,首先已经想到是桶来做了,但是细节还没细想,以为想到新办法利用indexOf(char c,int fromIndex)--
!!!!但是鬼知道这字符串里包含哪个字符啊!!!!