JuniorMath
Ugly Number
An ugly number is a positive integer which does not have a prime factor other than 2, 3, and 5.
Given an integer n, return true if n is an ugly number.
Example 1
Input
n = 6Output
true6 = 2 × 3.
Example 2
Input
n = 1Output
true1 has no prime factors.
Constraints
- -2^31 <= n <= 2^31 - 1