C++ || Nothing fancy || Clean and simple solution
\n int concatenatedBinary(int n) {\n        int ans=0;\n        long long bit=1;\n        for(int i=n;i>0;i--)\n        {\n            int num=i;\n            w
```\n int concatenatedBinary(int n) {\n        int ans=0;\n        long long bit=1;\n        for(int i=n;i>0;i--)\n        {\n            int num=i;\n            while(num)\n            {\n             if(num%2) ans= (ans+bit)%1000000007;\n              num/=2;\n              bit= (bit*2)%1000000007;\n            }\n        }\n        return ans;\n    }\n```
[]