1
class Solution:
2
def isUgly(self, n: int) -> bool:
3
if n == 0:
4
return False
5
res = [2, 3, 5]
6
while n != 1:
7
for i in res:
8
if n % i == 0:
9
n = n // i
10
break
11
else:
12
return False
13
return True

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0