[Python] Simple Solution - Casting of Types using built-ins
Approach: Convert int to binary (string to join) and then back to int.\n\n\nclass Solution:\n    def concatenatedBinary(self, n: int) -> int:\n        binaryStr
Approach: Convert int to binary (string to join) and then back to int.\n\n```\nclass Solution:\n    def concatenatedBinary(self, n: int) -> int:\n        binaryString = "" #our result in form of a string\n        for i in range(1,n+1):\n            #cast integer i into binary, and then to string, and remove the "0b" component in the front\n            binaryString += str(bin(i))[2:]\n        #cast from binary to integer\n        decimal = int(binaryString, 2)\n\n        return decimal % 1000000007\n```
['Python', 'Python3']