Write a function to find the \( n^{th}\ ugly \) number.
Ugly numbers are numbers whose only prime factors are \( 2 \), \( 3 \) or \( 5 \). We use dynamic programming to find the \( n^{th} \) ugly number.
Time complexity = \( O(n) \), space complexity = \( O(n) \). public int findNthUglyNumber(int n){ |