题目
Write a program to find the n
-th ugly number.
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5
.
Example:
1 | Input: n = 10 |
Note:
1
is typically treated as an ugly number.n
does not exceed 1690.
思路
DP.
代码
1 | class Solution(object): |