@@ -0,0 +1,409 @@
+public class Solution %7B%0A    public int nthUglyNumber(int n) %7B%0A        if(n %3C= 0)%7B%0A            return 0;%0A        %7D%0A        TreeSet%3CLong%3E ts = new TreeSet%3CLong%3E();%0A        long tmp = 1;%0A        ts.add((long)1);%0A        for(int i = 0; i %3C n; i ++)%7B%0A            tmp = ts.pollFirst();%0A            ts.add(tmp * 2);%0A            ts.add(tmp * 3);%0A            ts.add(tmp * 5);%0A        %7D%0A        return (int)tmp;%0A    %7D%0A%7D

Q264 Ugly Number II