Java binary strings solution
\nclass Solution {\n    public int concatenatedBinary(int n) {\n        int MOD = 1000000007;\n        int res = 1;\n        for (int i=2;i<=n;i++){\n          
```\nclass Solution {\n    public int concatenatedBinary(int n) {\n        int MOD = 1000000007;\n        int res = 1;\n        for (int i=2;i<=n;i++){\n            String s = Integer.toBinaryString(i);\n            for (char c: s.toCharArray()){\n                res=(res*2+c-48)%MOD;\n            }\n        }\n        return res;\n    }\n}\n```
[]