Python Elegant & Short | One line | Reducing
\nclass Solution:\n    """\n    Time:   O(n*log(n))\n    Memory: O(1)\n    """\n\n    MOD = 10 ** 9 + 7\n\n    def concatenatedBinary(self, n: int) -> int:\n   
```\nclass Solution:\n    """\n    Time:   O(n*log(n))\n    Memory: O(1)\n    """\n\n    MOD = 10 ** 9 + 7\n\n    def concatenatedBinary(self, n: int) -> int:\n        return reduce(lambda x, y: ((x << y.bit_length()) | y) % self.MOD, range(1, n + 1))\n```\n\nIf you like this solution remember to **upvote it** to let me know.
['Python', 'Python3']