A collection of LeetCode problems solved using TypeScript, featuring:
- 💡 Detailed explanations and approach breakdowns
- ✅ Comprehensive test coverage
- 🛠️ Interactive CLI test runner
- 📝 TypeScript best practices
- Clone the repository
git clone https://github.com/code-guy21/Leetcode-TS.git
cd Leetcode-TS
- Install dependencies
npm install
- Verify setup
npm test
The custom CLI provides an intuitive interface for running tests:
npm start
Features:
- 📂 Browse problems by category
- 🧪 Run specific problem tests
- 📊 View test coverage
Run all tests:
npm test
Run specific problem tests:
npm test src/tests/arrays/twoSum
Generate coverage report:
npm test -- --coverage
Watch mode:
npm run test:watch
src/
├── arrays/
│ ├── two-sum/
│ │ ├── index.ts # Solution implementation
│ │ ├── index.test.ts # Tests
│ │ └── README.md # Problem explanation
│ └── ...
├── strings/
├── linked-lists/
└── ...
Each problem solution includes:
- Detailed explanation of the approach
- Time and space complexity analysis
- Test cases covering edge cases
- TypeScript implementation
- Fork the repository
- Create your feature branch
git checkout -b feature/new-solution
- Implement your solution following our template:
- Add solution in
src/tests/category/problem-name/index.ts
- Add tests in
src/tests/category/problem-name/index.test.ts
- Add README.md with explanation
- Add solution in
- Commit your changes
- Push to the branch
- Create a Pull Request
- TypeScript 5.x
- Jest for testing
- Solutions prioritize readability and maintainability
- TypeScript features are used to enhance code safety
- Each solution includes performance considerations
- Regular updates with new problems and improvements
MIT
Don't forget to star ⭐ this repo if you find it helpful!