[c++] the fastest solution for this problem
\n#define min(x,y) (x < y ? x : y)\nint nthUglyNumber(int n) {\n  static int arr[1691] = {[0]= 1},\n  i  = 1, i2 = 0, i3 = 0, i5 = 0,\n  n2 = 2, n3 = 3, n5 = 5;
```\n#define min(x,y) (x < y ? x : y)\nint nthUglyNumber(int n) {\n  static int arr[1691] = {[0]= 1},\n  i  = 1, i2 = 0, i3 = 0, i5 = 0,\n  n2 = 2, n3 = 3, n5 = 5;\n  for (; i < n; i++) {\n    arr[i] = min(min(n2, n3), n5);\n    if (arr[i] == n2) n2 = 2 * arr[++i2];\n    if (arr[i] == n3) n3 = 3 * arr[++i3];\n    if (arr[i] == n5) n5 = 5 * arr[++i5];\n  }\n  return arr[n-1];\n}\n```\n[transmission from @dikshek](https://leetcode.com/problems/ugly-number-ii/discuss/213545/Runtime%3A-0-ms-faster-than-100.00-of-C-online-submissions-for-Ugly-Number-II.)\nreally really efficient\nupvote him not me
[]