[C++] Simple | O(nlogn) approach
\nclass Solution {\npublic:\n    long long int concatenatedBinary(int n) \n    {\n        long long mod=1e9+7;\n        long long sum=0,mul=1;\n        for(int 
```\nclass Solution {\npublic:\n    long long int concatenatedBinary(int n) \n    {\n        long long mod=1e9+7;\n        long long sum=0,mul=1;\n        for(int i=n;i>0;i--)\n        {\n            int k=i;\n            while(k>0)\n            {\n                sum=sum+(mul*(k%2))%mod;\n                k=k/2;\n                mul=(mul*2)%mod;\n            }\n        }\n        return sum%mod;\n    }\n};\n```
['C']