【LeetCode & 劍指offer刷題】特殊數題4:263 Ugly Number(系列)
阿新 • • 發佈:2019-01-05
【LeetCode & 劍指offer 刷題筆記】目錄(持續更新中...)
263. Ugly Number
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5 .-
1
- Input is within the 32-bit signed integer range: [−2 31 , 2 31 − 1].
- 1 is typically treated as an ugly number.
- n does not exceed 1690 .
- 1 is a super ugly number for any given primes .
- The given numbers in primes are in ascending order.
- 0 < k ≤ 100, 0 < n ≤ 10 6 , 0 < primes[i] < 1000.
- The n th super ugly number is guaranteed to fit in a 32-bit signed integer.