<awangdev>771. Jewels and Stones_1.java
public int numJewelsInStones(String J, String S) {
        if (J == null || J.length() == 0 || S == null || S.length() == 0) {
            return 0;
        }
        int m = J.length();
        Set<Character> set = new HashSet<>();
        int count = 0;
        for (char c : J.toCharArray()) {
            set.add(c);
        }
        for (char c : S.toCharArray()) {
            count += set.contains(c) ? 1 : 0;
        }
        return count;
    }
public int sample_funcname ( String var_1 , String var_2 ) {
  if ( var_1 == null || var_1 . length ( ) == 0 || var_2 == null || var_2 . length ( ) == 0 ) {
    return 0 ;
  }
  int var_6 = var_1 . length ( ) ;
  Set < Character > var_10 = new HashSet < > ( ) ;
  int var_11 = 0 ;
  for ( char var_13 : var_1 . toCharArray ( ) ) {
    var_10 . add ( var_13 ) ;
  }
  for ( char var_13 : var_2 . toCharArray ( ) ) {
    var_11 += var_10 . contains ( var_13 ) ? 1 : 0 ;
  }
  return var_11 ;
}
