Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.
Examples:
s = "leetcode"
return 0.
s = "loveleetcode",
return 2.
Note: You may assume the string contain only lowercase letters.
以下有两种方法:
package com.string;
/***
* @Author you guess
* @CreateTime 2019/6/19 9:44
*
* @Desc 从字符串中找到第一个不重复的字符
*
* Example 1:
* Input: s = "leetcode"
* Output: 0
*
* Example 2:
* Input: s = "loveleetcode"
* Output: 2
*
* Example 3:
* Input: s = "aabb"
* Output: -1
*/
public class