๐ง LeetCode Solutions
My personal collection of LeetCode solutions, automatically synced via GitHub Actions.
๐ Repository Structure
๐ฆ leetcode
โโโ ๐ .github/workflows
โ โโโ ๐ leetcode-sync.yml # GitHub Actions workflow
โโโ ๐ solutions # Auto-synced solutions
โ โโโ ๐ 1-two-sum.py
โ โโโ ๐ 2-add-two-numbers.py
โ โโโ ...
โโโ ๐ README.md
๐ How It Works
This repository uses the LeetCode Sync GitHub Action to automatically sync accepted LeetCode submissions to this repo.
- โฐ Schedule: Syncs every Saturday at 8:00 AM UTC (configurable via cron)
- ๐ฑ๏ธ Manual Trigger: Can also be triggered manually from the Actions tab
- ๐ Secure: LeetCode credentials are stored as encrypted GitHub Secrets
โ๏ธ Setup Guide
Want to set up your own? Follow these steps:
1. Get Your LeetCode Cookies
- Log in to leetcode.com
- Open Developer Tools (
F12orCtrl+Shift+I) - Go to Application โ Cookies โ
https://leetcode.com - Copy the values for:
csrftokenโ This is your CSRF TokenLEETCODE_SESSIONโ This is your Session Token
2. Add GitHub Secrets
Go to your repo โ Settings โ Secrets and variables โ Actions, and add:
| Secret Name | Value |
|---|---|
LEETCODE_CSRF_TOKEN |
Your csrftoken cookie |
LEETCODE_SESSION |
Your LEETCODE_SESSION cookie |
3. Enable the Workflow
The workflow file at .github/workflows/leetcode-sync.yml will automatically run on schedule. You can also trigger it manually:
- Go to the Actions tab in your repository
- Select Sync Leetcode
- Click Run workflow
๐ ๏ธ Technologies
๐ License
This project is open source and available under the MIT License.
โญ Star this repo if you find it useful!
Made with โค๏ธ and lots of โ