Questions based on Data Structures and Algorithm, which are frequently asked in Interviews. Ranging from Easy, Medium and Hard, these LeetCode questions covers roughly most of the DSA Topics, solve these to get a good grasp on your DSA knowledge.
Problems | Links |
---|---|
Two Sum | Link |
Roman to Integer | Link |
Longest Common Prefix | Link |
Valid Parentheses | Link |
Merge Two Sorted Lists | Link |
Remove Duplicates from Sorted Array | Link |
Find the Index of the First Occurrence in a String | Link |
Plus One | Link |
Sqrt(x) | Link |
Climbing Stairs | Link |
Merge Sorted Array | Link |
Binary Tree Inorder Traversal | Link |
Symmetric Tree | Link |
Maximum Depth of Binary Tree | Link |
Convert Sorted Array to Binary Search Tree | Link |
Pascal's Triangle | Link |
Best Time to Buy and Sell Stock | Link |
Valid Palindrome | Link |
Single Number | Link |
Linked List Cycle | Link |
Intersection of Two Linked Lists | Link |
Majority Element | Link |
Excel Sheet Column Number | Link |
Reverse Bits | Link |
Number of 1 Bits | Link |
Happy Number | Link |
Reverse Linked List | Link |
Contains Duplicate | Link |
Palindrome Linked List | Link |
Valid Anagram | Link |
Missing Number | Link |
Move Zeroes | Link |
Power of Three | Link |
Reverse String | Link |
Intersection of Two Arrays II | Link |
First Unique Character in a String | Link |
Fizz Buzz | Link |
Remove Letter to Equalize Frequency | Link |
Distribute Money to Maximum Children | Link |
Remove One Element to Make the Array Strictly Increasing | Link |
Longest Even-Odd Subarray with Threshold | Link |
Number of Valid Words in a Sentence | Link |
Can Place Flowers | Link |
X of a Kind in a Deck of Cards | Link |
Buddy Strings | Link |
Prime in Diagonal | Link |
Longest Alternating Subarray | Link |
Valid Mountain Array | Link |
Determine the Winner of a Bowling Game | Link |
Third Maximum Number | Link |
Problems | Links |
---|---|
Add Two Numbers | Link |
Longest Substring Without Repeating Characters | Link |
Longest Palindromic Substring | Link |
Reverse Integer | Link |
String to Integer (atoi) | Link |
Container With Most Water | Link |
3Sum | Link |
Letter Combinations of a Phone Number | Link |
Remove Nth Node From End of List | Link |
Generate Parentheses | Link |
Divide Two Integers | Link |
Search in Rotated Sorted Array | Link |
Find First and Last Position of Element in Sorted Array | Link |
Valid Sudoku | Link |
Count and Say | Link |
Permutations | Link |
Rotate Image | Link |
Group Anagrams | Link |
Pow(x, n) | Link |
Maximum Subarray | Link |
Spiral Matrix | Link |
Jump Game | Link |
Merge Intervals | Link |
Unique Paths | Link |
Set Matrix Zeroes | Link |
Sort Colors | Link |
Subsets | Link |
Word Search | Link |
Decode Ways | Link |
Validate Binary Search Tree | Link |
Binary Tree Level Order Traversal | Link |
Binary Tree Zigzag Level Order Traversal | Link |
Construct Binary Tree from Preorder and Inorder Traversal | Link |
Populating Next Right Pointers in Each Node | Link |
Best Time to Buy and Sell Stock II | Link |
Longest Consecutive Sequence | Link |
Surrounded Regions | Link |
Palindrome Partitioning | Link |
Gas Station | Link |
Copy List with Random Pointer | Link |
Word Break | Link |
LRU Cache | Link |
Sort List | Link |
Evaluate Reverse Polish Notation | Link |
Maximum Product Subarray | Link |
Min Stack | Link |
Find Peak Element | Link |
Fraction to Recurring Decimal | Link |
Factorial Trailing Zeroes | Link |
Largest Number | Link |
Rotate Array | Link |
House Robber | Link |
Number of Islands | Link |
Count Primes | Link |
Course Schedule | Link |
Implement Trie (Prefix Tree) | Link |
Course Schedule II | Link |
Kth Largest Element in an Array | Link |
Basic Calculator II | Link |
Kth Smallest Element in a BST | Link |
Lowest Common Ancestor of a Binary Tree | Link |
Delete Node in a Linked List | Link |
Product of Array Except Self | Link |
Search a 2D Matrix II | Link |
Perfect Squares | Link |
Find the Duplicate Number | Link |
Game of Life | Link |
Longest Increasing Subsequence | Link |
Coin Change | Link |
Wiggle Sort II | Link |
Odd Even Linked List | Link |
Increasing Triplet Subsequence | Link |
Flatten Nested List Iterator | Link |
Top K Frequent Elements | Link |
Sum of Two Integers | Link |
Kth Smallest Element in a Sorted Matrix | Link |
Insert Delete GetRandom O(1) | Link |
Shuffle an Array | Link |
Longest Substring with at Least K Repeating Characters | Link |
4Sum II | Link |
Minimum Cost to Make Array Equalindromic | Link |
Minimum Array Length After Pair Removals | Link |
Steps to Make Array Non-Decreasing | Link |
Count the Number of Square-Free Subsets | Link |
Maximize the Topmost Element After K Moves | Link |
Maximum Strength of a Group | Link |
K-Concatenation Maximum Sum | Link |
Maximum XOR Product | Link |
Walking Robot Simulation II | Link |
Non-Decreasing Array | Link |
Fraction to Recurring Decimal | Link |
Minimum Number of Groups to Create a Valid Assignment | Link |
Jump Game VII | Link |
Minimum Lines to Represent a Line Chart | Link |
Append K Integers with Minimal Sum | Link |
Apply Operations to Make Two Strings Equal | Link |
Minimum Sum of Squared Difference | Link |
Decremental String Concatenation | Link |
Minimum Seconds to Equalize a Circular Array | Link |
Problems | Links |
---|---|
Median of Two Sorted Arrays | Link |
Regular Expression Matching | Link |
Merge k Sorted Lists | Link |
First Missing Positive | Link |
Trapping Rain Water | Link |
Wildcard Matching | Link |
Minimum Window Substring | Link |
Largest Rectangle in Histogram | Link |
Binary Tree Maximum Path Sum | Link |
Word Ladder | Link |
Word Break II | Link |
Max Points on a Line | Link |
Word Search II | Link |
The Skyline Problem | Link |
Sliding Window Maximum | Link |
Alien Dictionary | Link |
Find Median from Data Stream | Link |
Serialize and Deserialize Binary Tree | Link |
Range Sum Query 2D - Mutable | Link |
Count of Smaller Numbers After Self | Link |
Longest Increasing Path in a Matrix | Link |
Strong Password Checker | Link |
Find Maximum Non-Decreasing Array Length | Link |
Minimum Reverse Operations | Link |
Booking Concert Tickets in Groups | Link |
Subarrays Distinct Element Sum of Squares II | Link |
Fancy Sequence | Link |
Number of Beautiful Integers in the Range | Link |
Maximum Number of Groups with Increasing Length | Link |
Valid Number | Link |
Count of Sub Multisets with Bounded Sum | Link |
Number of Ways to Separate Numbers | Link |
Find the Closest Palindrome | Link |
Maximum Balanced Subsequence Sum | Link |
Split the Array to Make Coprime Products | Link |
Modify Graph Edge Weights | Link |
Contains Duplicate III | Link |
Longest Increasing Subsequence II | Link |
Greatest Common Divisor Traversal | Link |
Find Substring with Given Hash Value | Link |
Minimum Time to Make Array Sum at Most X | Link |
Count Beautiful Substrings II | Link |
Count Complete Substrings | Link |
Minimum Number of Visited Cells in a Grid | Link |
Make Array Empty | Link |
Split Array with Same Average | Link |
Groups of Strings | Link |
Shortest Subarray with Sum at Least K | Link |
Max Points on a Line | Link |
Count the Number of Ideal Arrays | Link |
Count Stepping Numbers in Range | Link |
Abbreviating the Product of a Range | Link |
Handling Sum Queries After Update | Link |
Maximum Sum Queries | Link |
Word Ladder II | Link |
Wildcard Matching | Link |
Super Egg Drop | Link |
Sum of Total Strength of Wizards | Link |
Longest Common Subpath | Link |
String Transformation | Link |
Regular Expression Matching | Link |
Count K Subsequences of a String with Maximum Beauty | Link |
Maximum Strong Pair XOR II | Link |
Kth Smallest Product of Two Sorted Arrays | Link |
Sum of Floored Pairs | Link |
Maximum Total Beauty of the Gardens | Link |
Count Array Pairs Divisible by K | Link |
Maximize Value of Function in a Ball Passing Game | Link |
Maximum Strictly Increasing Cells in a Matrix | Link |
Create Maximum Number | Link |
Count the Repetitions | Link |