C++| 100% faster| EASY TO UNDERSTAND | clean and efficient
Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nAny suggestions and improvements are always welcome\n```\nclass 
***Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nAny suggestions and improvements are always welcome***\n```\nclass Solution {\npublic:\n    int bitwiseComplement(int n) {\n       int sum=0,i=0;\n        if(n==0)\n          return 1;  \n        while(n>0)\n        {\n            if(n%2==0)\n            {\n                sum+=1*pow(2,i);\n                i++;\n                n=n/2;\n            }\n            else\n            {\n                 i++;\n                    n=n/2;\n            }\n        }\n        return sum;\n    }\n};
['C']