LeetCode Problems
Note that:
- All solutions are written in Javascript.
- All explanations use Python notation for array splicing (eg.
arr[i:j]
is all elements from indexi
to indexj - 1
inclusive). - Most follow-ups are implemented as the primary solution, and so they do not have their own section.
- The datastructures-js priority queue library is used for min/max heaps.
- Normal Javascript arrays are used to simulate queues and dequeues (be aware
shift
andunshift
do not haveO(1)
runtime). - Javascript objects are frequently used to simulate maps and sets (feel free to use Map and Set instead).
- All dynamic programming (DP) solutions use a bottom-up approach.