This repository contains my solutions to LeetCode problems, implemented in Kotlin. Each solution includes unit tests and performance analysis.
src/
├── main/kotlin/
│ ├── datastructures/ # Data structure implementations
│ ├── algorithms/ # Core algorithms
│ └── leetcode/ # LeetCode solutions
│ └── easy/
│ └── arrays/
│ └── TwoSum.kt
└── test/kotlin/
└── leetcode/
└── easy/
└── arrays/
├── TwoSumTest.kt
└── TwoSumPerformanceTest.kt
- Problem: LeetCode - Two Sum
- Solutions:
- Brute Force (O(n²))
- Optimized with HashMap (O(n))
- Performance:
- Detailed runtime analysis
- Memory usage comparison
- View Solution
# Run all tests
./gradlew test
# Run tests for a specific problem
./gradlew test --tests "leetcode.easy.arrays.TwoSumTest"
# Run performance tests
./gradlew test --tests "leetcode.easy.arrays.performance.TwoSumPerformanceTest"Each solution includes:
- Performance tests with different input sizes
- Time and space complexity analysis
- Comparison between different approaches
- Runtime distribution visualization
- Kotlin 1.9.0
- JUnit 5
- Gradle
Each solution includes:
- Documentation with time/space complexity
- Unit tests
- Performance tests
- Multiple approaches (when relevant)
- Valid Parentheses
- Climbing Stairs
- Binary Search
- Reversed Linked List
- Palindrome Number
- Contains Duplicate
- Valid Anagram
- Maximum Subarray
Feel free to:
- Suggest improvements to existing solutions
- Propose new solutions
- Report bugs
- Add more test cases