Possibly, the easiest way (Java)
Just replace and that\'s it\n\nclass Solution {\n    public int findComplement(int num) {\n        String binary = Integer.toBinaryString(num);\n        binary 
Just replace and that\'s it\n```\nclass Solution {\n    public int findComplement(int num) {\n        String binary = Integer.toBinaryString(num);\n        binary = binary\n                .replace("0", "2")\n                .replace("1", "0")\n                .replace("2", "1");\n        return Integer.parseInt(binary, 2);\n    }\n}\n```
['Java']