Java || 100% fast Solution
\nclass Solution {\n    public int concatenatedBinary(int n) {\n        final long mod = (long)(1e9 + 7);\n        long result = 0;\n        int size = 0;\n    
```\nclass Solution {\n    public int concatenatedBinary(int n) {\n        final long mod = (long)(1e9 + 7);\n        long result = 0;\n        int size = 0;\n        for(int i = 1; i <= n; i++)\n        {\n            if((i & (i-1)) == 0)\n            {\n                size++;\n            }\n            result = ((result << size) | i)%mod;\n        }\n        \n        return (int)result;\n    }\n}\n```
['Bit Manipulation', 'Java']