dsa2 min read
Ugly Number II
Find the nth ugly number (only prime factors 2, 3, 5) using three pointers for the 2x, 3x, 5x merge streams.
Read →
webcoderspeed.com
2 articles
Find the nth ugly number (only prime factors 2, 3, 5) using three pointers for the 2x, 3x, 5x merge streams.
Find the nth super ugly number with prime factors only from a given list using K-pointer dynamic programming.