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.
List of LeetCode solutions along with related topics. Solutions in different programming languages like C++, Java, JavaScript, and Python.

# | Problem Title | Solution |
---|---|---|
1 | Two Sum | Solution |
2 | Add Two Numbers | Solution |
3 | Longest Substring Without Repeating Characters | Solution |
4 | Median of Two Sorted Arrays | Solution |
5 | Longest Palindromic Substring | Solution |
6 | Zigzag Conversion | Solution |
10 | Regular Expression Matching | Solution |
15 | 3Sum | Solution |
20 | Valid Parentheses | Solution |
21 | Merge Two Sorted Lists | Solution |
23 | Merge k Sorted Lists | Solution |
24 | Swap Nodes in Pairs | Solution |
25 | Reverse Nodes in k-Group | Solution |
# | Problem Title | Solution |
---|---|---|
26 | Remove Duplicates from Sorted Array | Solution |
27 | Remove Element | Solution |
28 | Find the Index of the First Occurrence in a String | Solution |
29 | Divide Two Integers | Solution |
30 | Substring with Concatenation of All Words | Solution |
32 | Longest Valid Parentheses | Solution |
33 | Search in Rotated Sorted Array | Solution |
35 | Search Insert Position | Solution |
37 | Sudoku Solver | Solution |
39 | Combination Sum | Solution |
40 | Combination Sum II | Solution |
41 | First Missing Positive | Solution |
42 | Trapping Rain Water | Solution |
43 | Multiply Strings | Solution |
44 | Wildcard Matching | Solution |
46 | Permutations | Solution |
47 | Permutations II | Solution |
48 | Rotate Image | Solution |
49 | Group Anagrams | Solution |
50 | Pow(x, n) | Solution |
# | Problem Title | Solution |
---|---|---|
68 | Text Justification | Solution |
70 | Climbing Stairs | Solution |
84 | Largest Rectangle in Histogram | Solution |
109 | Convert Sorted List to Binary Search Tree | Solution |
122 | Best Time to Buy and Sell Stock II | Solution |
136 | Single Number | Solution |
160 | Intersection of Two Linked Lists | Solution |
169 | Majority Element | Solution |
190 | Reverse Bits | Solution |
198 | House Robber | Solution |
202 | Happy Number | Solution |
206 | Reverse Linked List | Solution |
212 | Word Search II | Solution |
217 | Contains Duplicate | Solution |
219 | Contains Duplicate II | Solution |
220 | Contains Duplicate III | Solution |
221 | Maximal Square | Solution |
227 | Basic Calculator II | Solution |
237 | Delete Node in a Linked List | Solution |
258 | Add Digits | Solution |
292 | Nim Game | Solution |
Search Insert Position LeetCode Solution
Given a sorted array of distinct integers and a target value, return the index if…
Multiply Strings LeetCode Solution
Given two non-negative integers num1 and num2 represented as strings, return the product of num1…
Divide Two Integers LeetCode Solution
Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod…
Substring with Concatenation of All Words LeetCode Solution
You are given a string s and an array of strings words. All the strings…
Longest Substring Without Repeating Characters LeetCode Solution
Given a string s, find the length of the longest substring without repeating characters.
Text Justification LeetCode Solution
Given an array of strings words and a width maxWidth, format the text such that each line has…