the above is the program to find the nth ugly number
an ugly number is a number whose prime factorisation contains only 2,3, or 5 .
program is running infinitely what is the mistake in the program?
Ugly number dp question issue
You forgot to take, input for n.