Welcome to the LeetCodeSolutions-CSharp repository! 🚀 This repository contains solutions to various LeetCode problems implemented in C#.
You can find me on LeetCode at SergeyUrv 😊.
The project is structured into two main directories:
This directory contains my solutions to LeetCode problems, categorized by difficulty:
Easy
: Solutions to easy problems.Medium
: Solutions to medium problems.Hard
: Solutions to hard problems.
Each subdirectory contains individual C# files with solution implementations. 📁
This directory contains corresponding unit tests for each solution, also organized by difficulty:
Easy
: Tests for easy problems.Medium
: Tests for medium problems.Hard
: Tests for hard problems.
Each subdirectory contains unit test files written using xUnit framework to test the solutions in the LeetCode.Solutions
directory. 🧪
To get started with the LeetCode Solutions project, follow these steps:
Make sure you have the following installed:
- .NET SDK for running the project and tests.
-
Clone this repository to your local machine:
git clone https://github.com/SergeyUrvantsev/LeetCodeSolutions-CSharp.git cd LeetCode
-
Navigate to the test project and add a reference to the solutions project:
cd LeetCode.Tests dotnet add reference ../LeetCode.Solutions/LeetCode.Solutions.csproj
Now you're ready to explore the solutions and tests or add your own contributions! 🎉
The LeetCode Solutions project can be used for several purposes:
Feel free to explore the solutions provided in the LeetCode.Solutions
directory. Each solution is categorized by difficulty level, making it easy to find solutions to specific types of problems.
You can run the unit tests provided in the LeetCode.Tests
directory to verify the correctness of the solutions. Navigate to the LeetCode.Tests
directory and execute the following command:
cd LeetCode.Tests
dotnet test
The dotnet.yml
file in the .github/workflows
directory contains the GitHub Actions workflow configuration for building and testing the project. This workflow runs on every push to the main
branch and every pull request into the main
branch. It performs the following tasks:
- Restores dependencies for the LeetCode.Solutions project.
- Restores dependencies for the LeetCode.Tests project.
- Builds the LeetCode.Solutions project in Release configuration.
- Runs the tests for the LeetCode.Tests project in Release configuration.
For more information, please refer to the dotnet.yml file.
- 4. Median of Two Sorted Arrays: Efficient Median Calculation Using Binary Search
- 330. Patching Array: Greedy Approach for Minimum Patches
- 502. IPO: Efficient Project Selection for Maximizing Capital Before IPO
- 995. Minimum Number of K Consecutive Bit Flips: Efficient K-Bit Flip Solution
- 1713. Minimum Operations to Make a Subsequence: Analyzing Complexity Operations for Subsequence Transformation
While this repository primarily serves as a personal project, contributions are welcome via pull requests. If you have improvements to existing solutions or new solutions to add, feel free to submit a pull request. 🛠️
This project is licensed under the MIT License - see the LICENSE file for details. 📄