<qiyuangong>438_Find_All_Anagrams_in_a_String_1.java
public List<Integer> findAnagrams(String s, String p) {
        List<Integer> list = new ArrayList<>();
        if (s == null || s.length() == 0 || p == null || p.length() == 0) return list;
        int[] hash = new int[256]; //character hash
        for (char c : p.toCharArray()) {
            hash[c]++;
        }
        int left = 0, right = 0, count = p.length();
        while (right < s.length()) {
            if (hash[s.charAt(right++)]-- >= 1) count--; 
            if (count == 0) list.add(left);
            if (right - left == p.length() && hash[s.charAt(left++)]++ >= 0) count++;
        }
        return list;
    }
public List < Integer > var_1 ( String var_3 , String var_4 ) {
  List < Integer > var_7 = new ArrayList < > ( ) ;
  if ( var_3 == null || var_3 . length ( ) == 0 || var_4 == null || var_4 . length ( ) == 0 ) return var_7 ;
  int [ ] var_12 = new int [ 256 ] ;
  for ( char var_15 : var_4 . toCharArray ( ) ) {
    var_12 [ var_15 ] ++ ;
  }
  int var_16 = 0 , var_17 = 0 , var_18 = var_4 . length ( ) ;
  while ( var_17 < var_3 . length ( ) ) {
    if ( var_12 [ var_3 . charAt ( var_17 ++ ) ] -- >= 1 ) var_18 -- ;
    if ( var_18 == 0 ) var_7 . add ( var_16 ) ;
    if ( var_17 - var_16 == var_4 . length ( ) && var_12 [ var_3 . charAt ( var_16 ++ ) ] ++ >= 0 ) var_18 ++ ;
  }
  return var_7 ;
}
