A comprehensive collection of LeetCode problem solutions implemented in Dart. This repository follows a structured approach with unit tests for each solution.
LeetCode-Dart-Solutions/
│── lib/ # Contains LeetCode problem solutions
│ ├── easy/ # Easy difficulty problems
│ │ ├── two_sum.dart
│ │ ├── reverse_linked_list.dart
│ │ ├── valid_parentheses.dart
│ ├── medium/ # Medium difficulty problems
│ │ ├── longest_substring.dart
│ │ ├── binary_tree_level_order.dart
│ ├── hard/ # Hard difficulty problems
│ │ ├── median_sorted_arrays.dart
│── test/ # Unit tests for all solutions
│ ├── easy/
│ │ ├── two_sum_test.dart
│ │ ├── reverse_linked_list_test.dart
│ ├── medium/
│ │ ├── longest_substring_test.dart
│ ├── hard/
│ │ ├── median_sorted_arrays_test.dart
│── README.md # Documentation
│── pubspec.yaml # Dart dependencies
│── .gitignore # Git ignore file
git clone https://github.com/itsmelaxman/LeetCode-Dart-Solutions.git
cd LeetCode-Dart-Solutions
Ensure you have Dart installed, then run:
dart pub get
Run all test cases:
dart test
Run a specific test:
dart test test/easy/two_sum_test.dart
# | Problem | Solution |
---|---|---|
1 | Two Sum | two_sum.dart |
2 | Reverse Linked List | reverse_linked_list.dart |
3 | Valid Parentheses | valid_parentheses.dart |
4 | Merge Two Sorted Lists | merge_sorted_lists.dart |
# | Problem | Solution |
---|---|---|
5 | Longest Substring Without Repeating Characters | longest_substring.dart |
6 | Binary Tree Level Order Traversal | binary_tree_level_order.dart |
# | Problem | Solution |
---|---|---|
7 | Median of Two Sorted Arrays | median_sorted_arrays.dart |
We welcome contributions! If you’d like to add a new solution, follow these steps:
- Fork the repository
- Add your solution inside the respective
lib/
directory - Add a corresponding test case in
test/
- Open a Pull Request (PR)