less than 1 minute read

Given an integer n, return whether its prime factors only include 2, 3 or 5.

Constraints

  • 0 ≤ n < 2 ** 31

https://binarysearch.com/problems/Ugly-Number

Examples

Example 1

Input

  • n = 14

Output

  • answer = False

Explanation

14’s prime factors include 7.

Example 2

Input

  • n = 10

Output

  • answer = True

Explanation

10’s prime factors are 2 and 5.

Solution

Leave a comment