Skip to content

vardhan-the-dev/leetcode-cpp-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode C++ Solutions

A collection of 50 LeetCode problems solved in C++ (C++17).

Summary

Category Count Examples
Easy 25 Two Sum, Valid Parentheses, Merge Two Sorted Lists
Medium 15 3Sum, LRU Cache, Add Two Numbers
Hard 10 Median of Two Sorted Arrays, N-Queens, Trapping Rain Water
Total 50

File Structure

Each file is named with the problem number and title (e.g., 001-TwoSum.cpp). The files include:

  • Problem Description & Link
  • Time & Space Complexity Analysis
  • Complete Solution Class
  • Helper main() function for local testing

How to Run

You can compile any solution using a standard C++ compiler (like g++ or clang++).

# Example
g++ 001-TwoSum.cpp -o TwoSum
./TwoSum

List of Problems

Easy (25)

  1. Two Sum
  2. Reverse Integer
  3. Palindrome Number
  4. Roman to Integer
  5. Longest Common Prefix
  6. Valid Parentheses
  7. Merge Two Sorted Lists
  8. Remove Duplicates from Sorted Array
  9. Remove Element
  10. Implement strStr()
  11. Search Insert Position
  12. Maximum Subarray
  13. Length of Last Word
  14. Plus One
  15. Add Binary
  16. Sqrt(x)
  17. Climbing Stairs
  18. Remove Duplicates from Sorted List
  19. Merge Sorted Array
  20. Binary Tree Inorder Traversal
  21. Same Tree
  22. Symmetric Tree
  23. Maximum Depth of Binary Tree
  24. Convert Sorted Array to Binary Search Tree
  25. Pascal's Triangle

Medium (15)

  1. Add Two Numbers
  2. Longest Substring Without Repeating Characters
  3. Longest PalindromicSubstring
  4. Container With Most Water
  5. 3Sum
  6. Letter Combinations of a Phone Number
  7. Remove Nth Node From End of List
  8. Generate Parentheses
  9. Next Permutation
  10. Search in Rotated Sorted Array
  11. Find First and Last Position of Element in Sorted Array
  12. Valid Sudoku
  13. Group Anagrams
  14. Rotate Image
  15. LRU Cache

Hard (10)

  1. Median of Two Sorted Arrays
  2. Regular Expression Matching
  3. Merge k Sorted Lists
  4. Reverse Nodes in k-Group
  5. Longest Valid Parentheses
  6. Sudoku Solver
  7. First Missing Positive
  8. Trapping Rain Water
  9. N-Queens
  10. SlidingWindowMaximum

Created by vardhan-the-dev

About

Collection of 50 LeetCode solutions in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages