
Desicription
Write a program to check whether a given number is an ugly number.
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
Example 1:
1 |
Input: 6 |
Example 2:
1 |
Input: 8 |
Example 3:
1 |
Input: 14 |
Note:
- 1 is typically treated as an ugly number.
- Input is within the 32-bit signed integer range: [−2^31, 2^31 − 1].
Solution
1 |
class { |




近期评论