<gouthampradhan>bit_manipulation_GrayCode_1.java
public List<Integer> grayCode(int n) {
    List<Integer> result = new ArrayList<>();
    for (int i = 0; i <= ((1 << n) - 1); i++) result.add(i ^ (i >> 1));
    return result;
  }
public List < Integer > var_1 ( int var_2 ) {
  List < Integer > var_5 = new ArrayList < > ( ) ;
  for ( int var_7 = 0 ;
  var_7 <= ( ( 1 << var_2 ) - 1 ) ;
  var_7 ++ ) var_5 . add ( var_7 ^ ( var_7 >> 1 ) ) ;
  return var_5 ;
}
