Skip to content

jizusun/leetcode-with-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

87 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Practice LeetCode with JavaScript

Build Status Coverage Status codecov

JavaScript Runtime on LeetCode

  • nodejs 10.15.0
  • Run with --harmony flag, enabling new ES6 features. lodash.js library is included by default.

Source: LeetCode - What are the environments for the programming languages?

Record of Delibrate Practice

Front Matter

The front matter concept is learnt from Jekyll: https://jekyllrb.com/docs/front-matter/

The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines within a valid JavaScript block comment

Here is a basic example:

/*
---
created: 20190510
updated: 
  - 20190511
source: 
  - https://leetcode.com/problems/single-number/ 
level:
  - easy
tags: 
  - recursive
  - linked list
solutions: 
  - reverseList
    - runtime: 52 ms, beats 99.80%
    - memory: 35 MB, beats 47.37%
  - reverseListRecursive
    - runtime: 60 ms, beats 98.89%
    - memory: 35.4 MB, beats 15.38%
---
*/

Topics

https://leetcode.com/problemset/all/

1. Array

2. Hash Table

3. Linked List

4. Math

5. Two Pointers

6. String

7. Binary Search

8. Divide and Conquer

9. Dynamic Programming

10. Backtracking

11. Stack

12. Heap

13. Greedy

14. Sort

15. Bit Manipulation

16. Tree

17. Depth-first Search

18. Breadth-first Search

19. Union Find

20. Graph

21. Design

22. Topological Sort

23. Trie

24. Binary Indexed Tree

25. Segment Tree

26. Binary Search Tree

27. Recursion

28. Brainteaser

29. Memoization

30. Queue

31. Minimax

32. Reservoir Sampling

33. Map

34. Geometry

35. Random

36. Rejection Sampling

37. Sliding Window

Test Cases

I use Jest to test the programs, the test cases are defined in the problems/*/index.test.js:

yarn test                    # test all test cases

CI Tutorials:

Inspired by

References

About

๐ŸŽ Practice Leetcode with various solutions & unit tests

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages