comefrom: <awangdev>Next Closest Time_1.java
code: public String nextClosestTime(String time) {
          if (time == null || time.length() == 0) {
              return time;
          }
  
          Set<Integer> nums = new HashSet<>();
          for (int i = 0; i < time.length(); i++) {
              if (time.charAt(i) != ':') {
                  nums.add(time.charAt(i) - '0');
              }
          }
  
          Set<String> hh = new HashSet<>();
          for (int i : nums) {
              for (int j : nums) {
                  int num = i * 10 + j;
                  if (num >= 0 && num < 24) {
                      hh.add(i + "" + j);
                  }
              }
          }
  
          Set<String> mm = new HashSet<>();
          for (int i : nums) {
              for (int j : nums) {
                  int num = i * 10 + j;
                  if (num >= 0 && num < 60) {
                      mm.add(i + "" + j);
                  }
              }
          }
  
          String result = time;
          int timeValue = Integer.parseInt(time.substring(0, 2)) * 60 + Integer.parseInt(time.substring(3));
          int diff = Integer.MAX_VALUE;
          for (String h : hh) {
              for (String m : mm) {
                  String newTime = h + ":" + m;
                  int value = 0;
                  if (newTime.compareTo(time) <= 0) {
                      value = Integer.parseInt(h) * 60 + Integer.parseInt(m) + 1440;
                  } else {
                      value = Integer.parseInt(h) * 60 + Integer.parseInt(m);
                  }
                  if (value - timeValue < diff) {
                      diff = value - timeValue;
                      result = newTime;
                  }
              }
          }
  
          return result;
      }
masked: public String var_0 ( String var_2 ) {
    if ( var_2 == null || var_2 . length ( ) == 0 ) {
      return var_2 ;
    }
    Set < Integer > var_9 = new HashSet < > ( ) ;
    for ( int var_10 = 0 ;
    var_10 < var_2 . length ( ) ;
    var_10 ++ ) {
      if ( var_2 . charAt ( var_10 ) != ':' ) {
        var_9 . add ( var_2 . charAt ( var_10 ) - '0' ) ;
      }
    }
    Set < String > var_15 = new HashSet < > ( ) ;
    for ( int var_10 : var_9 ) {
      for ( int var_16 : var_9 ) {
        int var_18 = var_10 * 10 + var_16 ;
        if ( var_18 >= 0 && var_18 < 24 ) {
          var_15 . add ( var_10 + "" + var_16 ) ;
        }
      }
    }
    Set < String > var_21 = new HashSet < > ( ) ;
    for ( int var_10 : var_9 ) {
      for ( int var_16 : var_9 ) {
        int var_18 = var_10 * 10 + var_16 ;
        if ( var_18 >= 0 && var_18 < 60 ) {
          var_21 . add ( var_10 + "" + var_16 ) ;
        }
      }
    }
    String var_23 = var_2 ;
    int var_28 = Integer . parseInt ( var_2 . substring ( 0 , 2 ) ) * 60 + Integer . parseInt ( var_2 . substring ( 3 ) ) ;
    int var_30 = Integer . MAX_VALUE ;
    for ( String var_31 : var_15 ) {
      for ( String var_32 : var_21 ) {
        String var_34 = var_31 + ":" + var_32 ;
        int var_35 = 0 ;
        if ( var_34 . compareTo ( var_2 ) <= 0 ) {
          var_35 = Integer . parseInt ( var_31 ) * 60 + Integer . parseInt ( var_32 ) + 1440 ;
        }
        else {
          var_35 = Integer . parseInt ( var_31 ) * 60 + Integer . parseInt ( var_32 ) ;
        }
        if ( var_35 - var_28 < var_30 ) {
          var_30 = var_35 - var_28 ;
          var_23 = var_34 ;
        }
      }
    }
    return var_23 ;
  }
  