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

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0