static boolean multipleOfThree ( int K , int dig0 , int dig1 ) {
  long sum = 0 ;
  int temp = ( dig0 + dig1 ) % 10 ;
  sum = dig0 + dig1 ;
  if ( K == 2 ) {
    if ( sum % 3 == 0 ) return true ;
    else return false ;
  }
  sum += temp ;
  long numberofGroups = ( K - 3 ) / 4 ;
  int remNumberofDigits = ( K - 3 ) % 4 ;
  sum += ( numberofGroups * 20 ) ;
  for ( int i = 0 ;
  i < remNumberofDigits ;
  i ++ ) {
    temp = ( 2 * temp ) % 10 ;
    sum += temp ;
  }
  if ( sum % 3 == 0 ) return true ;
  else return false ;
}

static boolean multipleOfThree ( int K , int dig0 , int dig1 ) { long sum = 0 ; int temp = ( dig0 + dig1 ) % 10 ; sum = dig0 + dig1 ; if ( K == 2 ) { if ( sum % 3 == 0 ) return true ; else return false ; } sum += temp ; long numberofGroups = ( K - 3 ) / 4 ; int remNumberofDigits = ( K - 3 ) % 4 ; sum += ( numberofGroups * 20 ) ; for ( int i = 0 ; i < remNumberofDigits ; i ++ ) { temp = ( 2 * temp ) % 10 ; sum += temp ; } if ( sum % 3 == 0 ) return true ; else return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (return_statement (true)) alternative: (return_statement (false))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (return_statement (true)) alternative: (return_statement (false)))))