static boolean isDistinct ( int N ) {
  String s = "" + N ;
  int len = s . length ( ) ;
  int [ ] digits = new int [ len ] ;
  ArrayList < Integer > products = new ArrayList < > ( ) ;
  for ( int i = 0 ;
  i < len ;
  i ++ ) {
    digits [ i ] = Integer . parseInt ( "" + s . charAt ( i ) ) ;
  }
  for ( int i = 0 ;
  i < len ;
  i ++ ) {
    for ( int j = i ;
    j < len ;
    j ++ ) {
      int val = digitProduct ( digits , i , j ) ;
      if ( products . contains ( val ) ) return false ;
      else products . add ( val ) ;
    }
  }
  return true ;
}

static boolean isDistinct ( int N ) { String s = " " + N ; int len = s . length ( ) ; int [ ] digits = new int [ len ] ; ArrayList < Integer > products = new ArrayList < > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { digits [ i ] = Integer . parseInt ( " " + s . charAt ( i ) ) ; } for ( int i = 0 ; i < len ; i ++ ) { for ( int j = i ; j < len ; j ++ ) { int val = digitProduct ( digits , i , j ) ; if ( products . contains ( val ) ) return false ; else products . add ( val ) ; } } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (string_literal) right: (identifier)))) (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: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (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: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (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 (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_statement (false)) alternative: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))) (return_statement (true))))