question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use PriorityQueue on Leetcode but MaxPriorityQueue and MinPriorityQueue are working fine

See original GitHub issue

Leetcode 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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
eyas-ranjouscommented, Mar 19, 2022

v6 release + leetcode support contacted about it.

1reaction
eyas-ranjouscommented, Mar 14, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found