Javascript solution beats 100% submissions by caching
"use strict";\n    \n    var cache = [1];\n    var p2 = 0;\n    var p3 = 0;\n    var p5 = 0;\n    \n    var nthUglyNumber = function(n) {\n        var m,r2,r3,r
    "use strict";\n    \n    var cache = [1];\n    var p2 = 0;\n    var p3 = 0;\n    var p5 = 0;\n    \n    var nthUglyNumber = function(n) {\n        var m,r2,r3,r5;\n        var i = cache.length;\n        for(;i < n ; i++)\n        { \n            r2 = cache[p2] * 2;\n            r3 = cache[p3] * 3;\n            r5 = cache[p5] * 5;\n            m = Math.min(r2,r3,r5);\n            if(m === r2) p2++; \n            if(m === r3) p3++;\n            if(m === r5) p5++;\n            cache[i] = m;\n        }\n        return cache[n-1]; \n    };
['JavaScript']