Skip to content

Commit

Permalink
πŸ“ Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jobearrr authored Jul 3, 2024
1 parent b51ac0f commit dfca7ef
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,54 @@ Solutions to [LeetCode](https://leetcode.com/) problems written in Swift.

## Running the solutions

Each problem solution has a test case in the [`Tests`][test-cases-folder-url] folder.
Each solution has a test cases that can be found in the [SolutionsTests][solutions-tests-folder] folder.
So it should have 100% code coverage for obvious reasons. 😬

You can modify the test cases, provide new inputs and expected outputs.

Or you can run the companion app `LeetSwift` (🚧 under construction πŸ‘·), to browse and run the test cases of the solutions for the problems you would like to check.

## Project structure
Here's the representation of the project structure, to make it easier to navigate through all folders.
Here's the representation of the project structure, to make it easier to navigate through all the content.

Please pay attention to this if adding problems and implementing solutions, so everything conforms to this folder structure.
``` bash
.
β”œβ”€β”€ LeetSwift # Companion app
β”‚Β Β  └── ... # Project files
β”œβ”€β”€ LeetSwift # Companion app
β”‚Β Β  └── ... # Project files
β”œβ”€β”€ LeetSwift.xcworkspace
β”œβ”€β”€ Package.swift # LeetCode package spec
β”œβ”€β”€ Package.swift # LeetSwift package spec
β”œβ”€β”€ Sources
β”‚Β Β  └── LeetCode # Library folder
β”‚Β Β  β”œβ”€β”€ Core
β”‚Β Β  β”‚Β Β  └── ... # Ddata structures, helpers, etc.
β”‚Β Β  β”œβ”€β”€ Problems
β”‚Β Β  β”‚ β”œβ”€β”€ ...
β”‚Β Β  β”‚Β Β  └── XXX - Problem title
β”‚Β Β  β”‚Β Β  └── ProblemDefinition.swift # Problem definition
β”‚Β Β  └── Solutions
β”‚Β Β  β”œβ”€β”€ ...
β”‚Β Β  └── XXX - Problem title
β”‚Β Β  β”œβ”€β”€ ... # Other solutions
β”‚Β Β  └── Solution.swift # One solution
β”‚Β Β  β”œβ”€β”€ Core # Data structures, helpers, etc.
β”‚Β  β”‚Β Β  └── ...
β”‚Β Β  β”œβ”€β”€ Problems
β”‚Β Β  β”‚ β”œβ”€β”€ ...
β”‚Β Β  β”‚Β Β  └── XXX - Problem title
β”‚Β Β  β”‚Β Β  └── ProblemDefinition.swift # Problem definition
β”‚Β Β  β”œβ”€β”€ Solutions
β”‚Β Β  β”‚ β”œβ”€β”€ ...
β”‚Β Β  β”‚ └── XXX - Problem title
β”‚Β Β  β”‚ β”œβ”€β”€ ... # Other solutions
β”‚Β Β  β”‚ └── Solution.swift # One solution
β”‚ └── TestSupport # Testing support files
β”‚ β”œβ”€β”€ ...
β”‚ β”œβ”€β”€ Array+ListNode.swift
β”‚ β”œβ”€β”€ TestCaseProviding.swift
β”‚ └── TestData.swift
└── Tests
└── LeetCodeTests
β”œβ”€β”€ Core # LeetCode core tests
β”‚Β Β  └── ...
β”œβ”€β”€ Solutions # Test cases for solutions
β”‚ β”œβ”€β”€ ...
β”‚ └── XXX - Problem title
β”œβ”€β”€ ... # Test cases for other solutions
β”‚ └── SolutionTests.swift # Test cases for one solution
└── TestSupport # Testing support files
β”œβ”€β”€ ...
β”œβ”€β”€ Array+ListNode.swift
β”œβ”€β”€ TestCaseProviding.swift
β”œβ”€β”€ TestData.swift
└── Tests # Covers test code as well
β”œβ”€β”€ ...
β”œβ”€β”€ ArrayListNodeTests.swift
└── TestDataTests.swift
β”œβ”€β”€ Core # LeetCode core tests
β”‚Β Β  └── ...
β”œβ”€β”€ ProblemsTests # Input validation, etc.
β”‚ β”œβ”€β”€ ...
β”‚ └── XXX - Problem title
β”‚ └── ProblemTests.swift
β”œβ”€β”€ Solutions # Run test cases for solutions
β”‚ β”œβ”€β”€ ...
β”‚ └── XXX - Problem title
β”‚ β”œβ”€β”€ ... # Test cases for other solutions
β”‚ └── SolutionTests.swift # Test cases for one solution
└── TestSupportTests # Testing support files
└── ...
```

## Problems
Expand Down Expand Up @@ -98,13 +99,13 @@ If you would like to contribute, please use this same approach.
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg??style=flat&logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/jobertsa
[jobear-blog-url]: https://jobear.dev
[test-cases-folder-url]: https://github.com/jobearrr/LeetSwift/tree/main/Tests/LeetSwiftCoreTests/Problems
[solutions-tests-folder]: https://github.com/jobearrr/LeetSwift/tree/main/Tests/SolutionsTests
[difficulty-easy-shield]: https://img.shields.io/badge/%20Difficulty-Easy-brightgreen.svg
[difficulty-medium-shield]: https://img.shields.io/badge/%20Difficulty-Medium-orange.svg
[difficulty-hard-shield]: https://img.shields.io/badge/%20Difficulty-Hard-red.svg
[001-problem]: https://leetcode.com/problems/two-sum
[001-solution]: https://github.com/jobearrr/LeetSwift/blob/main/Sources/LeetCode/Solutions/001%20-%20Two%20Sum/TwoSumSolution.swift
[001-solution]: https://github.com/jobearrr/LeetSwift/blob/main/Sources/Solutions/001%20-%20Two%20Sum/TwoSumSolution.swift
[001-walkthrough]: https://jobear.dev
[002-problem]: https://leetcode.com/problems/add-two-numbers
[002-solution]: https://github.com/jobearrr/LeetSwift/blob/main/Sources/LeetCode/Solutions/002%20-%20Add%20Two%20Numbers/AddTwoNumbersSolution.swift
[002-solution]: https://github.com/jobearrr/LeetSwift/blob/main/Sources/Solutions/002%20-%20Add%20Two%20Numbers/AddTwoNumbersSolution.swift
[002-walkthrough]: https://jobear.dev

0 comments on commit dfca7ef

Please sign in to comment.