🔥%Multiple solutions 🎉||100%🔥Beats ✅
Code\ncpp []\n\n// approch brute bruteeeeee forceeeee every student can doooo\nclass Solution {\npublic:\n    string decimalTobinary(int n) {\n        string s 
# Code\n```cpp []\n\n// approch brute bruteeeeee forceeeee every student can doooo\nclass Solution {\npublic:\n    string decimalTobinary(int n) {\n        string s = "";\n        while (n) {\n            s = s + to_string(n % 2);\n            n = n / 2;\n        }\n        return s;\n    }\n    int binaryTodecimal(string s) {\n        int n = s.size();\n        int num = 0;\n        for (int i = n - 1; i >= 0; i--) {\n            num = num + (s[i] - \'0\') * pow(2, i);\n        }\n        return num;\n    }\n    int findComplement(int num) {\n        string s = decimalTobinary(num);\n        for (int i = 0; i < s.size(); i++) {\n            (s[i] == \'1\') ? s[i] = \'0\' : s[i] = \'1\';\n        }\n        return binaryTodecimal(s);\n    }\n};\n\n// approch 2 best and optimized space and time\n// class Solution {\n// public:\n//     int findComplement(int num) {\n//         int ans = 0;\n//         int i = 0;\n//         while (num) {\n//             (num % 2 == 1) ?: ans += pow(2, i);\n//             num /= 2;\n//             i++;\n//         }\n//         return ans;\n//     }\n// };\n// approch brute bruteeeeee forceeeee every student can doooo\n\n```
['Array', 'Bit Manipulation', 'Bitmask', 'Python', 'C++', 'Java', 'JavaScript']