C++||Easy to understand included comments in O(n)
\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        long long  int M = 1000000007;//modulo operator\n      long long  int d1=0,res;\n     
```\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        long long  int M = 1000000007;//modulo operator\n      long long  int d1=0,res;\n        for(long long int i=1;i<=n;i++){\n            d1=((d1<<(int(log2(i))+1))%M+i)%M;//shifting the bits to left side \n           \n            \n        }\n      \n     \n        return d1;\n    }\n};\n```
['C', 'C++']