This repository contains my solutions to various LeetCode problems implemented in C++. Each solution is organized in its own folder named after the problem's title or number, and it includes the C++ code, input/output examples, and any additional explanations.
1. Clone this repository to your local machine:
git clone https://github.com/your-username/leetcode-cpp-solutions.git
2. Navigate to the problem folder you're interested in:
cd leetcode-cpp-solutions/ProblemName
3. Open the .cpp file in your preferred C++ IDE or text editor to view the solution.
Problem contains questions related to Arrays, 2D Arrays, Matrix, Strings and other Data Structures and Algorithms in a folder along with their name, description and solution with approch explaination.
Contributions to this repository are welcome! If you have a better solution, improvement, or a new problem to add, follow these steps:
-
Fork this repository.
-
Create a new branch with a descriptive name:
git checkout -b feature/new-problem
-
Add your solution to the relevant problem folder.
-
Make sure your code is well-documented and includes explanations if needed.
-
Test your solution with different test cases to ensure correctness.
-
Commit your changes:
git commit -am 'Added solution for ProblemName'
- Push to your forked repository:
git push origin feature/new-problem
- Open a pull request describing the changes you've made.
LeetCode for providing a platform to practice coding skills.
@Ps1231 for creating and maintaining this repository.
0053-maximum-subarray |
0169-majority-element |
0191-number-of-1-bits |
0493-reverse-pairs |
0560-subarray-sum-equals-k |
0724-find-pivot-index |
1966-frequency-of-the-most-frequent-element |
0169-majority-element |
0229-majority-element-ii |
0451-sort-characters-by-frequency |
0136-single-number |
0191-number-of-1-bits |
0231-power-of-two |
0338-counting-bits |
0054-spiral-matrix |
2271-rearrange-array-elements-by-sign |
0128-longest-consecutive-sequence |
0036-valid-sudoku |
0048-rotate-image |
0054-spiral-matrix |
0073-set-matrix-zeroes |
0007-reverse-integer |
0009-palindrome-number |
0013-roman-to-integer |
0048-rotate-image |
0050-powx-n |
0070-climbing-stairs |
0189-rotate-array |
0231-power-of-two |
1013-fibonacci-number |
0451-sort-characters-by-frequency |
0451-sort-characters-by-frequency |
0050-powx-n |
0231-power-of-two |
1013-fibonacci-number |
0493-reverse-pairs |
0493-reverse-pairs |
0493-reverse-pairs |
0493-reverse-pairs |
0237-delete-node-in-a-linked-list |
0908-middle-of-the-linked-list |
0020-valid-parentheses |
0155-min-stack |
0225-implement-stack-using-queues |
0232-implement-queue-using-stacks |
0496-next-greater-element-i |
0678-valid-parenthesis-string |
1078-remove-outermost-parentheses |
0155-min-stack |
0225-implement-stack-using-queues |
0232-implement-queue-using-stacks |
0225-implement-stack-using-queues |
0232-implement-queue-using-stacks |
0496-next-greater-element-i |
0070-climbing-stairs |
1013-fibonacci-number |
0455-assign-cookies |
0678-valid-parenthesis-string |
0890-lemonade-change |
1049-minimum-domino-rotations-for-equal-row |
1966-frequency-of-the-most-frequent-element |
0003-longest-substring-without-repeating-characters |
1966-frequency-of-the-most-frequent-element |