1201. Ugly Number III
https://leetcode.com/problems/ugly-number-iii
Description
An ugly number is a positive integer that is divisible by a
, b
, or c
.
Given four integers n
, a
, b
, and c
, return the nth
ugly number.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= n, a, b, c <= 109
1 <= a * b * c <= 1018
It is guaranteed that the result will be in range
[1, 2 * 109]
.
ac
Last updated