Problem
An ugly number is a positive integer whose only prime factors are 2, 3 and 5. By convention, 1 is the first ugly number. The sequence starts 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ... (7 and 11 are missing because they are prime, 14 because it has the factor 7).
Given n, return the `n`th ugly number.
Example 1
- Input
- n = 1
- Output
- 1
Example 2
- Input
- n = 10
- Output
- 12
Example 3
- Input
- n = 11
- Output
- 15
Constraints
1 <= n <= 1690