Runtime: 8 ms, faster than 90.74% of C++ online submissions
\n\n      int nthUglyNumber(int n) {\n                  if (n == 0) return 0;\n                  int arr[n];\n                  arr[0]=1;\n                  int
\n\n      int nthUglyNumber(int n) {\n                  if (n == 0) return 0;\n                  int arr[n];\n                  arr[0]=1;\n                  int i2=0,i3=0,i5=0;\n                  for(int i=1;i<n;i++){\n                      arr[i]=min(arr[i2]*2,min(arr[i3]*3,arr[i5]*5));\n                      if(arr[i]==arr[i2]*2){\n                              i2++;\n                      }\n                      if(arr[i]==arr[i3]*3){\n                              i3++;\n                      }\n                      if(arr[i]==arr[i5]*5){\n                          i5++;\n                      }\n                  }\n                  return arr[n-1];\n          }\n\t\t  \n**Feel free to ask any question in the comment section.\nIf you like this solution, do UPVOTE.\nHappy Coding :)**\n\t
['Dynamic Programming', 'C++']