LeetCode Solution

LeetCode is the best platform to help you enhance your skills, expand your knowledge and prepare for technical interviews.

Our top interview questions are divided into levels of difficulty of problems like Easy, Medium, and Hard to help you master Data Structure & Algorithms and improve your coding skills.

Leetcode problem and solution
#Problem TitleSolution
1Two SumSolution
2Add Two NumbersSolution
3Longest Substring Without Repeating CharactersSolution
4Median of Two Sorted ArraysSolution
5Longest Palindromic SubstringSolution
6Zigzag ConversionSolution
10Regular Expression MatchingSolution
20Valid ParenthesesSolution
21Merge Two Sorted ListsSolution
23Merge k Sorted ListsSolution
24Swap Nodes in PairsSolution
25Reverse Nodes in k-GroupSolution
#Problem TitleSolution
26Remove Duplicates from Sorted ArraySolution
27Remove ElementSolution
28Find the Index of the First Occurrence in a StringSolution
29Divide Two IntegersSolution
30Substring with Concatenation of All WordsSolution
32Longest Valid ParenthesesSolution
33Search in Rotated Sorted ArraySolution
35Search Insert PositionSolution
37Sudoku SolverSolution
39Combination SumSolution
40Combination Sum IISolution
41First Missing PositiveSolution
42Trapping Rain WaterSolution
43Multiply StringsSolution
44Wildcard MatchingSolution
47Permutations IISolution
48Rotate ImageSolution
49Group AnagramsSolution
50Pow(x, n)Solution
#Problem TitleSolution
68Text JustificationSolution
70Climbing StairsSolution
84Largest Rectangle in HistogramSolution
109Convert Sorted List to Binary Search TreeSolution
122Best Time to Buy and Sell Stock IISolution
136Single NumberSolution
160Intersection of Two Linked ListsSolution
169Majority ElementSolution
190Reverse BitsSolution
198House RobberSolution
202Happy NumberSolution
206Reverse Linked ListSolution
212Word Search IISolution
217Contains DuplicateSolution
219Contains Duplicate IISolution
220Contains Duplicate IIISolution
221Maximal SquareSolution
227Basic Calculator IISolution
237Delete Node in a Linked ListSolution
258Add DigitsSolution
292Nim GameSolution
Scroll to Top