Search⌘ K
AI Features

Solution: Ugly Number II

C# solution for the Ugly Number II problem using the Dynamic Programming pattern.

Statement

Given an integer n, return the nth ugly number.

An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

Note: 1 is considered an ugly number.

Constraints:

  • 1 ...