Can't use PriorityQueue on Leetcode but MaxPriorityQueue and MinPriorityQueue are working fine
See original GitHub issueLeetcode support datastructure-js/priority-queue
as the site mentioned here.
It is ok if I use MinPriorityQueue
and MaxPriorityQueue
, but when I tried to use
let tasksQueue = new PriorityQueue({ compare: [customCompare]})
It say ReferenceError: PriorityQueue is not defined. Import with CommonJS or ESModule doesn’t work either. Module is still exporting from index.js file, so I’m not sure what the issue is here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
PriorityQueue custom comparator broken - LeetCode Discuss
Please fix custom comparator from Priority Queue class. I was trying to solve the fourth contest problem today and ran into this error:...
Read more >[JavaScript] using datastrucutres-js/priority-queue, min and max
front() , it returns an object with properties priority and element . in our use case, these values will both equal the element,...
Read more >Why does my Java PriorityQueue solution not work? - LeetCode
Hi all,. I have the following solution using PriorityQueue, however, it failed for some cases and I cannot figure out the reason. ......
Read more >JavaScript using Max Priority Queue with comments - LeetCode
forEach((num) => { if (num % 2 !== 0) { const value = num * 2; mpq.enqueue(value, value); } else { mpq ...
Read more >Javascript Max Priority Queue Solution Explained - LeetCode
we could use a max priority queue. iterate the array, build a hash map of all seen element and count; build a max...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v6 release + leetcode support contacted about it.
hi @toantd90 unfortunately, leetcode has not upgraded to latest version. I am also working on a new major version, that will make using this library way easier for everybody. I will talk to leetcode support about it in order to upgrade to it.