✔️Python🔥One-liner✅Bit shift | Detailed explain | Beginner-friendly | Easy understand
Main idea:\n1. We loop through 1 to 2^29 using Bit shift.\n2. And using Counter() to check if every digit in n is in power of two.\n\nOne-liner code:\npython\nc
**Main idea:**\n1. We loop through 1 to 2^29 using Bit shift.\n2. And using Counter() to check if every digit in n is in power of two.\n\n**One-liner code:**\n```python\nclass Solution:\n    def reorderedPowerOf2(self, n: int) -> bool:\n        return Counter(str(n)) in [Counter(str(1 << i)) for i in range(30)]\n```\n\nAnd here\'s the code for better understand:\n```python\nclass Solution:\n    def reorderedPowerOf2(self, n: int) -> bool:\n        digits = Counter(str(n))\n        \n        for i in range(30):\n            if digits == Counter(str(1 << i)):\n                return True\n        return False\n```\n\nFor those who don\'t know bit shift:\nThis is how power of 2 in binary looks like:\nAnd we keep left shift the number to get every power of 2.\n```\n1  -> 1\n2  -> 10\n4  -> 100\n8  -> 1000\n16 -> 10000\n32 -> 100000\n64 -> 1000000\n```\n**Please UPVOTE if you LIKE!!**
['Python']