<awangdev>387. First Unique Character in a String_3.java
public int firstUniqChar(String s) {
        if (s == null || s.length() == 0) return -1;
        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            map.putIfAbsent(c, 0);
            map.put(c, map.get(c) + 1);
        }
        
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (map.get(c) == 1) return i;
        }
        return -1;
    }
public int sample_funcname ( String var_1 ) {
  if ( var_1 == null || var_1 . length ( ) == 0 ) return - 1 ;
  Map < Character , Integer > var_10 = new HashMap < > ( ) ;
  for ( int var_11 = 0 ;
  var_11 < var_1 . length ( ) ;
  var_11 ++ ) {
    char var_13 = var_1 . charAt ( var_11 ) ;
    var_10 . putIfAbsent ( var_13 , 0 ) ;
    var_10 . put ( var_13 , var_10 . get ( var_13 ) + 1 ) ;
  }
  for ( int var_11 = 0 ;
  var_11 < var_1 . length ( ) ;
  var_11 ++ ) {
    char var_13 = var_1 . charAt ( var_11 ) ;
    if ( var_10 . get ( var_13 ) == 1 ) return var_11 ;
  }
  return - 1 ;
}
