EASY JAVA SOLUTION USING ARRAYLIST👾
PLEASE UPVOTE IF YOU LIKED THE SOLUTION\n\nclass Solution {\n    public int nthUglyNumber(int n) {\n        int twoin=0;\n        int threein=0;\n        int fi
**PLEASE UPVOTE IF YOU LIKED THE SOLUTION**\n```\nclass Solution {\n    public int nthUglyNumber(int n) {\n        int twoin=0;\n        int threein=0;\n        int fivein=0;\n        int temp=n;\n        List<Integer>list=new ArrayList<>();\n        list.add(1);\n        while(temp-- >1){\n            int by2=list.get(twoin)*2;\n            int by3 =list.get(threein)*3;\n            int by5 = list.get(fivein)*5;\n            \n            int min = Math.min(by2,Math.min(by3,by5));\n            list.add(min);\n            if(min==by2)twoin++;\n            if(min==by3)threein++;\n            if(min==by5)fivein++;\n            \n        }\n        return list.get(n-1);\n    }\n}\n```
['Array', 'Java']