1class Solution:2def reorderedPowerOf2(self, n: int) -> bool:3counter = Counter(str(n))4power = 05counter_for_2 = Counter(str(2**power))6while counter_for_2.total() <= counter.total():7if counter_for_2 == counter:8return True9power += 110counter_for_2 = Counter(list(str(2**power)))11return False