My LeetCode solutions, synced automatically to this repo with GitHub Actions.
.
├── .github/workflows/leetcode-sync.yml # sync workflow
└── solutions/ # one folder per problem
└── <id>-<problem-name>/
├── README.md # problem statement
└── <solution file> # accepted submission
The workflow uses joshcai/leetcode-sync. Every 6 hours (or on manual trigger) it:
- Fetches my accepted submissions from LeetCode
- Commits new ones to
solutions/ - Uses commit messages in the form
[LeetCode Sync] Runtime - ... , Memory - ...
- Create a repo and add
.github/workflows/leetcode-sync.ymlfrom this repo. - Add these repository secrets (Settings → Secrets and variables → Actions):
LEETCODE_CSRF_TOKEN: thecsrftokencookie from leetcode.comLEETCODE_SESSION: theLEETCODE_SESSIONcookie from leetcode.com
- Settings → Actions → General → Workflow permissions → Read and write.
- Run the workflow from the Actions tab.
LEETCODE_SESSION expires after a few weeks and must be refreshed in the secrets.
<Python / SQL / ...>