LeetCode Solution
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



LeetCode Solution

# Title Solution
1 Two Sum C++
2 Add Two Numbers C++
3 Longest Substring Without Repeating Characters C++
4 Median of Two Sorted Arrays C++
5 Longest Palindromic Substring C++
7 Letter Combinations of a Phone Number C++
8 String to Integer (atoi) C++
10 Regular Expression Matching C++
12 Integer to Roman C++
13 Roman to Integer C++
14 Longest Common Prefix C++
15 3Sum C++
16 3Sum Closest C++
18 4Sum* C++
19 Remove Nth Node From End of List C++
20 Valid Parentheses C++
21 Merge Two Sorted Lists C++
23 Merge k Sorted Lists C++
24 Swap Nodes in Pairs C++
25 Reverse Nodes in k-Group C++
26 Remove Duplicates from Sorted Array C++
27 Remove Element C++
28 Implement strStr() C++
28 Next Permutation C++
32 Longest Valid Parentheses C++
33 Search in Rotated Sorted Array C++
34 Find First and Last Position of Element in Sorted Array C++
35 Search Insert Position C++
36 Valid Sudoku C++
38 Count and Say C++
41 First Missing Positive C++
42 Trapping Rain Water C++
44 Wildcard Matching C++
46 Permutations C++
48 Rotate Image C++
49 Group Anagrams C++
50 Pow(x, n) C++
53 Maximum Subarray C++
58 Length of Last Word C++
60 Permutation Sequence C++
61 Rotate List C++
62 Unique Paths C++
63 Unique Paths II C++
65 Valid Number C++
66 Plus One C++
67 Add Binary C++
69 Sqrt(x) C++
70 Climbing Stairs C++
71 Simplify Path C++
73 Set Matrix Zeroes C++
74 Search a 2D Matrix C++
75 Sort Colors C++
77 Combinations C++
78 Subsets C++
80 Remove Duplicates from Sorted Array II C++
81 Search in Rotated Sorted Array II C++
82 Remove Duplicates from Sorted List II C++
83 Remove Duplicates from Sorted List C++
84 Largest Rectangle in Histogram C++
86 Partition List C++
88 Merge Sorted Array C++
89 Gray Code C++
90 Subsets II C++
92 Reverse Linked List II C++
94 Binary Tree Inorder Traversal C++
95 Unique Binary Search Trees II C++
96 Unique Binary Search Trees C++
98 Validate Binary Search Tree C++
99 Recover Binary Search Tree C++
100 Same Tree C++
101 Symmetric Tree C++
102 Binary Tree Level Order Traversal C++
103 Binary Tree Zigzag Level Order Traversal C++
104 Maximum Depth of Binary Tree C++
105 Construct Binary Tree from Preorder and Inorder Traversal C++
106 Construct Binary Tree from Inorder and Postorder Traversal C++
107 Binary Tree Level Order Traversal II C++
108 Convert Sorted Array to Binary Search Tree C++
109 Convert Sorted List to Binary Search Tree C++
110 Balanced Binary Tree C++
111 Minimum Depth of Binary Tree C++
112 Path Sum C++
113 Path Sum II C++
114 Flatten Binary Tree to Linked List C++
116 Populating Next Right Pointers in Each Node C++
117 Populating Next Right Pointers in Each Node II C++
125 Valid Palindrome C++
128 Longest Consecutive Sequence C++
124 Binary Tree Maximum Path Sum C++
134 Gas Station C++
135 Candy C++
129 Sum Root to Leaf Numbers C++
136 Single Number C++
137 Single Number II C++
138 Copy List with Random Pointer C++
141 Linked List Cycle C++
142 Linked List Cycle II C++
143 Reorder List C++
144 Binary Tree Preorder Traversal C++
145 Binary Tree Postorder Traversal C++
146 LRU Cache C++
147 Insertion Sort List C++
148 Sort List C++
150 Evaluate Reverse Polish Notation C++
206 Reverse Linked List C++
445 Add Two Numbers II C++
454 4Sum II C++
460 LFU Cache C++
680 Valid Palindrome II C++