Easily Understandable solution || 100% T.C ||CPP
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int bitwiseComplement(int n) {\n        if(n==0) return 1;\n        vector<int> v;\n        int num=n;\n        while(num!=0){\n            int r=num%2;\n            v.push_back(r);\n            num/=2;\n        }\n        for(int i=0;i<v.size();i++){\n            if(v[i]==1) v[i]=0;\n            else v[i]=1;\n        }\n        // reverse(v.begin(),v.end());\n        int j=0;\n        int ans=0;\n        for(int i=0;i<v.size();i++){\n            int ag=pow(2,j);\n            j++;\n            ans+=v[i]*ag;\n        }\n        return ans;\n    }\n};\n```
['C++']