Kata a command-line companion for LeetCode that helps you practice coding problems using TTD.
It brings LeetCode practice to your terminal supporting a TDD-first approach. Use your environment, write your tests, submit your solutions, train on the same problems to build muscle memory.
curl -LsSf https://raw.githubusercontent.com/phantompunk/kata/main/scripts/install.sh | shReview script: install.sh before running.
irm https://raw.githubusercontent.com/phantompunk/kata/main/scripts/install.ps1 | iexReview script: install.ps1 before running.
go install github.com/phantompunk/kata@latest
git clone https://github.com/phantompunk/kata.git
cd kata
go build# Download and stub a problem
kata get two-sum
# Add your solution
vim ~/katas/two_sum/two_sum.go
# Test your solution
kata test two-sum
# See your progress
kata list# Stub problem using id
kata get 15
# Stub problem using slug
kata get 3sum
# Specify language
kata get 3sum --language python
# Open immediately in editor
kata get 3sum -l python --open
# Refresh problem stubs
kata get 3sum --forceTest your solutions against LeetCode's servers:
# Test using default language
kata test 3sum
# Test using specific language
kata test 3sum --language!Note: Testing against LeetCode requires authentication
Submit your solutions to LeetCode's servers:
# Submit using default language
kata submit 3sum
# Submit using specific language
kata submit 3sum --language!Note: Testing against LeetCode requires authentication
View your completed problems:
kata listNeed to authenticate to test or submit against LeetCode servers.
# Login using browser cookies (automatically extracts session data)
kata loginGet a random problem to solve:
kata quizOpen settings in your editor:
kata settings# default language
language: go
# open file
openInEditor: false
# track progress for langauges
tracks:
- Go
- Python
# useful for debugging
verbose: false
# workspace for kata files
workspace: ~/Workspace/katasSee contributing.
MIT License - see LICENSE file for details.
Happy coding! Practice makes permanent. 🥋
