@@ -0,0 +1,566 @@
+class Solution(object):%0A    def isUgly(self, num):%0A        %22%22%22%0A        :type num: int%0A        :rtype: bool%0A        %22%22%22%0A        if num %3C 1:%0A            return False%0A    %0A        bad_factors = (2, 3, 5)%0A    %0A        stack = %5Bnum%5D%0A    %0A        while len(stack) %3E 0:%0A            x = stack.pop()%0A    %0A            if x == 1:%0A                return True%0A            else:%0A                for bad_factor in bad_factors:%0A                    if x %25 bad_factor == 0:%0A                        y = x // bad_factor%0A                        stack.append(y)%0A    %0A        return False%0A

Create solution.py