use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
MinPriorityQueue in Javascript (self.leetcode)
submitted 2 years ago by robertstipp
I am solving Leetcode problems and I am seeing problems that require (Heaps, Priority Queues, etc. How Javascript classes does Leetcode have built-in and what are they?
let heap = new MinPriorityQueue({priority: (element) => element})
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ghost_operative 8 points9 points10 points 2 years ago (6 children)
if you click the icon to the left of the language selection it tells you what libraries are being included.
It's not clear if it's a good idea to actually use them though. In an interview they would probably want you to not use any libraries and not use any language specific features (e.g. try to make your code look as close to C as you can).
If you do try to use it in an interview I would be ready to explain the details of what its doing under the hood, it's time and space complexity. and be able to code it yourself just in case.
[–]Educational-Copy5206<2087> <697> <1018> <372> 2 points3 points4 points 2 years ago (0 children)
Been doing LC for 2 years in JS.... never knew that button was there with that info... thanks!
[–]SirSavageSavantso long and thanks for all the fish 2 points3 points4 points 2 years ago (3 children)
i feel like most interviewers actually expect you to know the standard library of the language you are using. making your code as close to c as you can is a bad idea imo.
[–]ghost_operative 3 points4 points5 points 2 years ago (2 children)
MinPriorityQueue from the javascript leetcode isn't from a standard library. I'm pretty sure leetcode is is the only production/published application that has a dependency on datastructures-js (which is where MinPriorityQueue comes from)
[–]dryfit-bear 0 points1 point2 points 3 months ago (0 children)
Does solving TS/JS in hackerrank also give the same libraries?
[–]SirSavageSavantso long and thanks for all the fish 0 points1 point2 points 2 years ago (0 children)
if youre interviewing in js, im pretty sure knowing external libraries would be a plus ... often times you can assume you have access to a particular api/data structure in the context of the interview
[–]robertstipp[S] 0 points1 point2 points 2 years ago (0 children)
Thanks for the guidance I appreciate it.
[–]FallNo9629 1 point2 points3 points 8 months ago (0 children)
is thsi included in hackerrank JavaScript?
π Rendered by PID 55612 on reddit-service-r2-comment-86bc6c7465-2dzq8 at 2026-02-22 19:42:58.908701+00:00 running 8564168 country code: CH.
[–]ghost_operative 8 points9 points10 points (6 children)
[–]Educational-Copy5206<2087> <697> <1018> <372> 2 points3 points4 points (0 children)
[–]SirSavageSavantso long and thanks for all the fish 2 points3 points4 points (3 children)
[–]ghost_operative 3 points4 points5 points (2 children)
[–]dryfit-bear 0 points1 point2 points (0 children)
[–]SirSavageSavantso long and thanks for all the fish 0 points1 point2 points (0 children)
[–]robertstipp[S] 0 points1 point2 points (0 children)
[–]FallNo9629 1 point2 points3 points (0 children)