100% faster c++ solution | 24ms runtime | 10 lines of code
Kindly Upvote \uD83D\uDC4D the solution if you like it...\n\n\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        int next = 1, length = 1;
## Kindly Upvote \uD83D\uDC4D the solution if you like it...\n\n```\nclass Solution {\npublic:\n    int concatenatedBinary(int n) {\n        int next = 1, length = 1;\n        long max_n = pow(10, 9) + 7, result = 0;\n        for (int i = 0; i <= n; i++) {\n            if (i == next) {\n                next *= 2;\n                length++;\n            }\n            \n            result = (result * next + i) % max_n;\n        }\n        return result;\n    }\n};\n```\n\n\n## If you reached here and the solution worked for you please upvote its free \uD83D\uDC4D
['C++']