static int find_sub ( String s , int k ) {
  int len = s . length ( ) ;
  int lp = 0 , rp = 0 ;
  int ans = 0 ;
  int [ ] hash_char = new int [ 26 ] ;
  for ( ;
  rp < len ;
  rp ++ ) {
    hash_char [ s . charAt ( rp ) - 'a' ] ++ ;
    while ( hash_char [ s . charAt ( rp ) - 'a' ] > k ) {
      hash_char [ s . charAt ( lp ) - 'a' ] -- ;
      lp ++ ;
    }
    ans += rp - lp + 1 ;
  }
  return ans ;
}

static int find_sub ( String s , int k ) { int len = s . length ( ) ; int lp = 0 , rp = 0 ; int ans = 0 ; int [ ] hash_char = new int [ 26 ] ; for ( ; rp < len ; rp ++ ) { hash_char [ s . charAt ( rp ) - ' a ' ] ++ ; while ( hash_char [ s . charAt ( rp ) - ' a ' ] > k ) { hash_char [ s . charAt ( lp ) - ' a ' ] -- ; lp ++ ; } ans += rp - lp + 1 ; } return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (for_statement condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))))) (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (identifier))) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (return_statement (identifier))))