<awangdev>246. Strobogrammatic Number_2.java
public boolean isStrobogrammatic(String num) {
        if (num == null || num.length() == 0) return true;
        if (num.length() == 1) return num.equals("0") || num.equals("1") || num.equals("8");
        List<Character> candidate = new ArrayList<>(Arrays.asList('0', '1', '8', '6', '9'));
        char[] charArray = num.toCharArray();
        for (int i = 0; i < charArray.length; i++) {
            if (!candidate.contains(charArray[i])) return false;
            if (charArray[i] == '6') charArray[i] = '9';
            else if (charArray[i] == '9') charArray[i] = '6';
        }
        StringBuffer sb = new StringBuffer(String.valueOf(charArray));
        String reversedNum = sb.reverse().toString();
        return num.equals(reversedNum);
    }
public boolean var_0 ( String var_2 ) {
  if ( var_2 == null || var_2 . length ( ) == 0 ) return true ;
  if ( var_2 . length ( ) == 1 ) return var_2 . equals ( "0" ) || var_2 . equals ( "1" ) || var_2 . equals ( "8" ) ;
  List < Character > var_21 = new ArrayList < > ( Arrays . asList ( '0' , '1' , '8' , '6' , '9' ) ) ;
  char [ ] var_23 = var_2 . toCharArray ( ) ;
  for ( int var_24 = 0 ;
  var_24 < var_23 . length ;
  var_24 ++ ) {
    if ( ! var_21 . contains ( var_23 [ var_24 ] ) ) return false ;
    if ( var_23 [ var_24 ] == '6' ) var_23 [ var_24 ] = '9' ;
    else if ( var_23 [ var_24 ] == '9' ) var_23 [ var_24 ] = '6' ;
  }
  StringBuffer var_28 = new StringBuffer ( String . valueOf ( var_23 ) ) ;
  String var_31 = var_28 . reverse ( ) . toString ( ) ;
  return var_2 . equals ( var_31 ) ;
}
