[Python\C++] simple 4 liner. (Inbuilt and bitwise)
Using Python Inbuilt bin method:\nPython\n\n def concatenatedBinary(self, n: int) -> int:\n        res = ""\n        for i in range(1,n+1):\n            res+=bi
Using Python Inbuilt bin method:\nPython\n```\n def concatenatedBinary(self, n: int) -> int:\n        res = ""\n        for i in range(1,n+1):\n            res+=bin(i)[2:]\n        return int(res,2)%(10**9 + 7)\n```\n\nUsing bitwise operation:\nC++\n\n```\nint concatenatedBinary(int n) {\n        long int res = 0, shift = 0 ;\n        long int mod = 1e9 + 7;\n        for (long int i = 1; i<=n; i++){\n            if( (i & (i-1)) == 0)\n                shift+=1;\n            res = ((res<<shift)|i )%mod;\n            \n        }\n        return res;\n    }\n```
['Python3']