Java | String | Straight Forward Solution | Easy to Understand
\nclass Solution {\n    public int concatenatedBinary(int n) {\n        StringBuilder str = new StringBuilder();\n        for(int i = 1; i <= n; i++)\n         
```\nclass Solution {\n    public int concatenatedBinary(int n) {\n        StringBuilder str = new StringBuilder();\n        for(int i = 1; i <= n; i++)\n            str.append(Integer.toBinaryString(i));\n        int MAX = 1000000007;\n        int res = 0;\n        String s = str.reverse().toString();\n        int c = 1;\n        for(int i = 0; i < s.length(); i++){\n            res += (s.charAt(i)-\'0\')*c;\n            res %= MAX;\n            c *= 2;\n            c %= MAX;\n        }\n        return res;\n    }\n}\n\n```
['String', 'Java']