C++ Easy solution ||  Bit manipulation
\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        \n        //start from n to 1\n        long long ans=1;\n        for(int i=2;i<=n;i++)
```\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        \n        //start from n to 1\n        long long ans=1;\n        for(int i=2;i<=n;i++)\n        {\n            //calculate the bits in the current number (i)\n            long long  num=(log(i)/log(2)) + 1;\n            //left shift the bits as we need to append the i\n            ans=ans<<num;\n            ans|=i;\n            ans%=1000000007;\n        }\n        return ans;\n    }\n};\n```\n**upvote if this helps you :)**
['C']