Logo

LeetCode

All my solutions in one place.
Explore the page »

Current Status

Language Number of Solutions
Python 93
Java 15

Adding Solutions

  1. Add file name to directory with the solution directly from LeetCode submission.

Example:

$ touch "python/1. Two Sum"     # create python sol.
$ vi "python/1. Two Sum"        # add python sol.
$ vi "java/1. Two Sum"          # edit java sol.
  1. Run the sh scripts/add.sh utility script to count number of solutions, rename to file name, format code, commit with appropriate message (ex: <language> : added/updated/deleted solution for problem 0001), and push to repository.

Example:

$ sh scripts/add.sh
------------------------------
Language   Number of Solutions
------------------------------
Python     2
Java       2
------------------------------
Renamed 'python/1. Two Sum' to '0001-two-sum.py'

$ git log
commit  <hash> (HEAD -> main, origin/main)
Author: <name> <email>
Date:   <timestamp>
    python: added solution for problem 0001

commit  <hash>
Author: <name> <email>
Date:   <timestamp>
    java: updated solution for problem 0001