A collection of LeetCode problem solutions implemented in TypeScript with detailed complexity analysis and test coverage.
- Type-Safe Solutions: All solutions written in TypeScript with strict type checking enabled
- Testing: Full Jest test coverage for all solutions
- Complexity Analysis: Detailed time and space complexity documentation for each solution
- Organized Structure: Problems organized by difficulty level (Easy, Medium, Hard)
- Tagged Solutions: Solutions tagged with relevant data structures and algorithms
leetcode-ts/
├── src/
│   └── problems/
│       ├── easy/
│       │   ├── 1-two-sum/
│       │   │   ├── solution.ts
│       │   │   └── solution.test.ts
│       │   └── 217-contains-duplicate/
│       │       ├── solution.ts
│       │       └── solution.test.ts
│       └── hard/
│           └── 329-longest-increasing-path-in-a-matrix/
│               ├── solution.ts
│               └── solution.test.ts
├── jest.config.js
├── tsconfig.json
└── package.json
- Node.js (v18 or higher)
- npm
- Clone the repository:
git clone https://github.com/kobukuro/leetcode-ts.git
cd leetcode-ts- Install dependencies:
npm installRun all tests:
npm testRun tests for a specific problem:
npm test -- 1-two-sum| # | Title | Tags | Solution | Tests | 
|---|---|---|---|---|
| 1 | Two Sum | Hash Table | solution.ts | solution.test.ts | 
| 217 | Contains Duplicate | Hash Set | solution.ts | solution.test.ts | 
| # | Title | Tags | Solution | Tests | 
|---|---|---|---|---|
| 329 | Longest Increasing Path in a Matrix | DFS, Memoization | solution.ts | solution.test.ts | 
- TypeScript: Static type checking and modern JavaScript features
- Jest: Testing framework
- ts-jest: TypeScript preprocessor for Jest
This project uses strict TypeScript configuration:
- Target: ES2024
- Strict mode enabled
- Consistent casing in file names enforced