Ugly Number
Problem statement
Return whether n is a positive integer whose prime factors are limited to 2, 3, and 5. The number 1 is ugly because it has no prime factors.
Function
isUgly(n: int) → booleanExamples
Example 1
n = 6return = true6 equals 2 times 3.
Example 2
n = 1return = trueOne has no prime factors.
Example 3
n = 14return = falseThe factor 7 is forbidden.
Constraints
-2^31 <= n <= 2^31 - 1.