[JAVA] - Simple Short Concise Priority Queue - Beginner
\nclass Solution {\n    public int nthSuperUglyNumber(int n, int[] primes) {\n        PriorityQueue<Long> pq = new PriorityQueue<>();\n        pq.add(1L);\n    
```\nclass Solution {\n    public int nthSuperUglyNumber(int n, int[] primes) {\n        PriorityQueue<Long> pq = new PriorityQueue<>();\n        pq.add(1L);\n        \n        for(int prime : primes){\n            pq.add(1L * prime);\n        }\n        \n        long ans=-1L;\n        \n        while(n>0){\n            long curr = pq.poll();\n            if(curr!=ans){\n                n--;\n                for(int prime : primes){\n                    pq.add(curr*prime);\n                }\n            }\n            \n            ans = curr;\n        }\n        \n        return (int)ans;\n    }\n}\n```
[]