Recognize Positive Numbers with Only Three Allowed Prime Factors
Company: Google
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
### Problem
A positive ugly number has no prime factors outside 2, 3 and 5. Return whether n is ugly; 1 qualifies because it has no prime factors.
```cpp
bool isUgly(int n);
```
### Examples
```text
n = 30 -> true
n = 22 -> false
```
### Constraints
- n is any signed 32-bit integer.
Overview: Recognize Positive Numbers with Only Three Allowed Prime Factors. A positive ugly number has no prime factors outside 2, 3 and 5. Return whether n is ugly; 1 qualifies because it has no prime factors.