Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 3.22 KB

CONTRIBUTING.md

File metadata and controls

52 lines (35 loc) · 3.22 KB

Contributing

Please read the guidelines below before opening a PR

Solutions from these languages will be linked from NeetCode.io:

  • Python (complete)
  • C++ (complete)
  • Java
  • Javascript

Solutions are also welcome for any other supported language on leetcode.com!

To contribute, please fork this repo and open a PR adding a missing solution from the supported languages.

If you would like to have collaborator permissions on the repo to merge your own PRs or review others' PRs please let me know.

Contributing Guidelines

  • Match the casing of files and directories
    • For files, it's <language>/<problem-set>/<category>/<problem-number>_name_of_problem.<language-extension> (e.g. java/neetcode_150/01_arrays_&_hashing/0001_two_sum.java)
    • Please add the appropriate number of preceding zeros to the problem number, to ensure files get sorted properly (e.g. 0001, 0012, 0123, 1234)
    • Please take the problem name from the URL of the problem, as described in this issue
  • Give your PR a succinct and accurate title (e.g. "Create: 1-Two-Sum.py")
  • Prefer one solution/change per PR (not a hard and fast rule, but will typically make the review cycle shorter)
  • Follow the PR template and add additional information when needed
  • Make sure your code passes submission on leetcode.com for the problem it solves
  • Write clean code (Your code should use semantically meaningful variable/method names, consistent style, etc) and easy to understand. for example, a single letter is probably not a semantically meaningful name
  • Ensure the problem is not already solved in the language you're contributing in

FAQs

Q: What should my solution include?

A: You can keep your solution exactly the same as the one you submit to leetcode, you don't need to write tests or your own implementation of leetcode's built-ins.

Q: What if there are multiple ways to solve the problem?

A: Multiple solutions to the same problem are accepted (as long as they differ in approach or time/memory complexity), although the first solution should always follow the same algorithm shown on the channel. Please make sure distinct solutions are grouped together in the same file, with appropriately differentiating names (e.g. isValidBstIterative and isValidBstRecursive)

Q: What if my solution has a lower runtime but the same time/memory complexity?

A: Leetcode's runtime measurement can be severely inaccurate varying based on server load, time of day and many other factors. In general, readability and clarity of the code (in the context of interviews) are features more important than performance gains, however changes that transparently improve performance will be accepted.

Q: What if the problem I want to add isn't in the Neetcode 150 list (Missing Solutions table)?

A: Questions outside of the Neetcode 150 list can be added but please prioritise adding the listed solutions first.

Thanks for contributing 🚀