Author: github.com/ankuralld5999
My C++ code of LeetCode Problem-Set Series (from starting).
Before checking solution you try to solve it by yourself (atleast once).👍
Please give a repo a ⭐ , if you like (it means a lot).
Thanks for support. 😊
| # | Title | Difficulty | Language | Solution |
|---|---|---|---|---|
| 1 | Two Sum | Easy | C++ | Solution |
| 2 | Add Two Numbers | Medium | C++ | Solution |
| 3 | Longest Substring Without Repeating Characters | Medium | C++ | Solution |
| 4 | Median of Two Sorted Arrays | Hard | C++ | Solution |
| 5 | Longest Palindromic Substring | Medium | C++ | Solution |
| 6 | ZigZag Conversion | Medium | C++ | Solution |
| 7 | Reverse Integer | Easy | C++ | Solution |
| 8 | String to Integer (atoi) | Medium | C++ | Solution |
| 9 | Palindrome Number | Easy | C++ | Solution |
| 10 | Regular Expression Matching | Hard | C++ | Solution |
| 11 | Container With Most Water | Medium | C++ | Solution |
| 12 | Integer to Roman | Medium | C++ | Solution |
| 13 | Roman to Integer | Easy | C++ | Solution |
| 14 | Longest Common Prefix | Easy | C++ | Solution |
| 15 | 3Sum | Medium | C++ | Solution |
| 16 | 3Sum Closest | Medium | C++ | Solution |
| 17 | Letter Combinations of a Phone Number | Medium | C++ | Solution |
| 18 | 4Sum | Medium | C++ | Solution |
| 19 | Remove Nth Node From End of List | Medium | C++ | Solution |
| 20 | Valid Parentheses | Easy | C++ | Solution |
| 21 | Merge Two Sorted Lists | Easy | C++ | Solution |
| 22 | Generate Parentheses | Medium | C++ | Solution |
| 23 | Merge k Sorted Lists | Hard | C++ | Solution |
| 24 | Swap Nodes in Pairs | Medium | C++ | Solution |
| 25 | Reverse Nodes in k-Group | Hard | C++ | Solution |
| 26 | Remove Duplicates from Sorted Array | Easy | C++ | Solution |
| 27 | Remove Element | Easy | C++ | Solution |
| 28 | Implement strStr() | Easy | C++ | Solution |
| 29 | Divide Two Integers | Medium | C++ | Solution |
| 30 | Substring with Concatenation of All Words | Hard | C++ | Solution |
| 31 | Next Permutation | Medium | C++ | Solution |
| 32 | Longest Valid Parentheses | Hard | C++ | Solution |
| 33 | Search in Rotated Sorted Array | Medium | C++ | Solution |
| 34 | Find First and Last Position of Element in Sorted Array | Medium | C++ | Solution |
| 35 | Search Insert Position | Easy | C++ | Solution |
| 36 | Valid Sudoku | Medium | C++ | Solution |
| 37 | Sudoku Solver | Hard | C++ | Solution |
| 38 | Count and Say | Easy | C++ | Solution |
| 39 | Combination Sum | Medium | C++ | Solution |
| 40 | Combination Sum II | Medium | C++ | Solution |
| 41 | First Missing Positive | Hard | C++ | Solution |
| 42 | Trapping Rain Water | Hard | C++ | Solution |
| 43 | Multiply Strings | Medium | C++ | Solution |
| 44 | Wildcard Matching | Hard | C++ | Solution |
| 45 | Jump Game II | Hard | C++ | Solution |
| 46 | Permutations | Medium | C++ | Solution |
| 47 | Permutations II | Medium | C++ | Solution |
| 48 | Rotate Image | Medium | C++ | Solution |
| 49 | Group Anagrams | Medium | C++ | Solution |
| 50 | Pow(x, n) | Medium | C++ | Solution |
| 51 | N-Queens | Hard | C++ | Solution |
| 52 | N-Queens II | Hard | C++ | Solution |
| 53 | Maximum Subarray | Easy | C++ | Solution |
| 54 | Spiral Matrix | Medium | C++ | Solution |
| 55 | Jump Game | Medium | C++ | Solution |
| 56 | Merge Intervals | Medium | C++ | Solution |
| 57 | Insert Interval | Medium | C++ | Solution |
| 58 | Length of Last Word | Easy | C++ | Solution |
| 59 | Spiral Matrix II | Medium | C++ | Solution |
| 60 | Permutation Sequence | Hard | C++ | Solution |
| 61 | Rotate List | Medium | C++ | Solution |
| 62 | Unique Paths | Medium | C++ | Solution |
| 63 | Unique Paths II | Medium | C++ | Solution |
| 64 | Minimum Path Sum | Medium | C++ | Solution |
| 65 | Valid Number | Hard | C++ | Solution |
| 66 | Plus One | Easy | C++ | Solution |
| 67 | Add Binary | Easy | C++ | Solution |
| 68 | Text Justification | Hard | C++ | Solution |
| 69 | Sqrt(x) | Easy | C++ | Solution |
| 70 | Climbing Stairs | Easy | C++ | Solution |
| 71 | Simplify Path | Medium | C++ | Solution |
| 72 | Edit Distance | Hard | C++ | Solution |
| 73 | Set Matrix Zeroes | Medium | C++ | Solution |
| 74 | Search a 2D Matrix | Medium | C++ | Solution |
| 75 | Sort Colors | Medium | C++ | Solution |
| 76 | Minimum Window Substring | Hard | C++ | Solution |
| 77 | Combinations | Medium | C++ | Solution |
| 78 | Subsets | Medium | C++ | Solution |
| 79 | Word Search | Medium | C++ | Solution |
| 80 | Remove Duplicates from Sorted Array II | Medium | C++ | Solution |
| 81 | Search in Rotated Sorted Array II | Medium | C++ | Solution |
| 82 | Remove Duplicates from Sorted List II | Medium | C++ | Solution |
| 83 | Remove Duplicates from Sorted List | Easy | C++ | Solution |
| 84 | Largest Rectangle in Histogram | Hard | C++ | Solution |
| 85 | Maximal Rectangle | Hard | C++ | Solution |
| 86 | Partition List | Medium | C++ | Solution |
| 87 | Scramble String | Hard | C++ | Solution |
| 88 | Merge Sorted Array | Easy | C++ | Solution |
| 89 | Gray Code | Medium | C++ | Solution |
| 90 | Subsets II | Medium | C++ | Solution |
| 91 | Decode Ways | Medium | C++ | Solution |
| 92 | Reverse Linked List II | Medium | C++ | Solution |
| 93 | Restore IP Addresses | Medium | C++ | Solution |
| 94 | Binary Tree Inorder Traversal | Medium | C++ | Solution |
| 95 | Unique Binary Search Trees II | Medium | C++ | Solution |
| 96 | Unique Binary Search Trees | Medium | C++ | Solution |
| 97 | Interleaving String | Hard | C++ | Solution |
| 98 | Validate Binary Search Tree | Medium | C++ | Solution |
| 99 | Recover Binary Search Tree | Hard | C++ | Solution |
| 100 | Same Tree | Easy | C++ | Solution |
| 101 | Symmetric Tree | Easy | C++ | Solution |
| 102 | Binary Tree Level Order Traversal | Medium | C++ | Solution |
| 103 | Binary Tree Zigzag Level Order Traversal | Medium | C++ | Solution |
| 104 | Maximum Depth of Binary Tree | Easy | C++ | Solution |
| 105 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | C++ | Solution |
| 106 | Construct Binary Tree from Inorder and Postorder Traversal | Medium | C++ | Solution |
| 107 | Binary Tree Level Order Traversal II | Medium | C++ | Solution |
| 108 | Convert Sorted Array to Binary Search Tree | Easy | C++ | Solution |
| 109 | Convert Sorted List to Binary Search Tree | Medium | C++ | Solution |
| 110 | Balanced Binary Tree | Easy | C++ | Solution |
| 111 | Minimum Depth of Binary Tree | Easy | C++ | Solution |
| 112 | Path Sum | Easy | C++ | Solution |
| 113 | Path Sum II | Easy | C++ | Solution |
| 114 | Flatten Binary Tree to Linked List | Medium | C++ | Solution |
| 115 | Distinct Subsequence | Hard | C++ | Solution |
| 116 | Populating Next Right Pointers in Each Node | Medium | C++ | Solution |
| 117 | Populating Next Right Pointers in Each Node II | Medium | C++ | Solution |
| 118 | Pascal's Triangle | Easy | C++ | Solution |
| 119 | Pascal's Triangle II | Easy | C++ | Solution |
| 120 | Triangle | Medium | C++ | Solution |
| 121 | Best Time to Buy and Sell Stock | Easy | C++ | Solution |
| 122 | Best Time to Buy and Sell Stock II | Easy | C++ | Solution |
| 123 | Best Time to Buy and Sell Stock III | Hard | C++ | Solution |
| 124 | Binary Tree Maximum Path Sum | Hard | C++ | Solution |
| 125 | Valid Palindrome | Easy | C++ | Solution |
| 126 | Word Ladder II | Hard | C++ | Solution |
| 127 | Word Ladder | Hard | C++ | Solution |
| 128 | Longest Consecutive Sequence | Hard | C++ | Solution |
| 129 | Sum Root to Leaf Numbers | Medium | C++ | Solution |
| 130 | Surrounded Regions | Medium | C++ | Solution |
| 131 | Palindrome Partitioning | Medium | C++ | Solution |
| 132 | Palindrome Partitioning II | Hard | C++ | Solution |
| 133 | Clone Graph | Medium | C++ | Solution |
| 134 | Gas Station | Medium | C++ | Solution |
| 135 | Candy | Medium | C++ | Solution |
| 136 | Single Number | Easy | C++ | Solution |
| 137 | Single Number II | Medium | C++ | Solution |
| 138 | Copy List with Random Pointer | Medium | C++ | Solution |
| 139 | Word Break | Medium | C++ | Solution |
| 140 | Word Break II | Hard | C++ | Solution |
| 141 | Linked List Cycle | Easy | C++ | Solution |
| 142 | Linked List Cycle II | Medium | C++ | Solution |
| 143 | Reorder List | Medium | C++ | Solution |
| 144 | Binary Tree Preorder Traversal | Easy | C++ | Solution |
| 145 | Binary Tree Postorder Traversal | Easy | C++ | Solution |
| 146 | LRU Cache | Medium | C++ | Solution |
| 147 | Insertion Sort List | Medium | C++ | Solution |
| 148 | Sort List | Medium | C++ | Solution |
| 149 | Max Points on a Line | Hard | C++ | Solution |
| 150 | Evaluate Reverse Polish Notation | Medium | C++ | Solution |
| 151 | Reverse Words in a String | Medium | C++ | Solution |
| 152 | Maximum Product Subarray | Medium | C++ | Solution |
| 153 | Find Minimum in Rotated Sorted Array | Medium | C++ | Solution |
| 154 | Find Minimum in Rotated Sorted Array II | Hard | C++ | Solution |
| 155 | Min Stack | Easy | C++ | Solution |
| 156 | Binary Tree Upside Down | Medium | C++ | Solution |
All rights reserved by github.com/ankuralld5999. Contact me if you want to redistribute the code. No commercial use.