https://leetcode.com/problems/complement-of-base-10-integer/
class Solution { public int bitwiseComplement(int N) { String x = Integer.toBinaryString(N); StringBuilder out = new StringBuilder(); for (int i = 0; i <span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span>< x.length(); i++){ if(x.charAt(i) == '0') out.append("1"); else out.append("0"); } return Integer.parseInt(out.toString(), 2); }}