Skip to content

250 must solve leetcode questions spanning across various dsa topics.

Notifications You must be signed in to change notification settings

Tejas07PSK/fraz-leetcode-hot-250

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

fraz-leetcode-hot-250

250 must solve leetcode questions spanning across various dsa topics.

Table Of Contents

Sl. No. Problem Name/Link Difficulty Solution Link
Array
1 Two Sum 🍏 πŸ‘‰
2 Best Time To Buy and Sell Stock 🍏 πŸ‘‰
3 Merge Sorted Array 🍏 πŸ‘‰
4 Move Zeroes 🍏 πŸ‘‰
5 Best Time To Buy and Sell Stock II πŸ‹ πŸ‘‰
6 Running Sum of 1d Array 🍏 πŸ‘‰
7 Find Pivot Index πŸ‹ πŸ‘‰
8 Majority Element 🍏 πŸ‘‰
9 Fibonacci Number 🍏 πŸ‘‰
10 Squares of a Sorted Array 🍏 πŸ‘‰
11 Pascal's Triangle 🍏 πŸ‘‰
12 Remove Duplicates from Sorted Array πŸ‹ πŸ‘‰
13 3 Sum πŸ‹ πŸ‘‰
14 Product of Array Except Self πŸ‹ πŸ‘‰
15 Insert Delete GetRandom O(1) πŸ‹ πŸ‘‰
16 Subarray Sum Equals K πŸ‹ πŸ‘‰
17 Next Permutation πŸ‹ πŸ‘‰
18 Spiral Matrix πŸ‹ πŸ‘‰
19 Container With Most Water πŸ‹ πŸ‘‰
20 Rotate Image πŸ‹ πŸ‘‰
21 Word Search πŸ‹ πŸ‘‰
22 3Sum Closest πŸ‹ πŸ‘‰
23 Game of Life πŸ‹ πŸ‘‰
24 Pairs of Songs With Total Durations Divisible by 60 πŸ‹ πŸ‘‰
25 4 Sum πŸ‹ πŸ‘‰
26 Find the Duplicate Number πŸ‹ πŸ‘‰
27 Combination Sum πŸ‹ πŸ‘‰
28 Jump Game II πŸ‹ πŸ‘‰
29 Maximum Points You Can Obtain from Cards πŸ‹ πŸ‘‰
30 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts πŸ‹ πŸ‘‰
31 Max Area of Island πŸ‹ πŸ‘‰
32 Find All Duplicates in an Array πŸ‹ πŸ‘‰
33 K-diff Pairs in an Array πŸ‹ πŸ‘‰
34 Subsets πŸ‹ πŸ‘‰
35 Invalid Transactions πŸ‹ πŸ‘‰
36 Jump Game I πŸ‹ πŸ‘‰
37 Subarray Sums Divisible by K πŸ‹ πŸ‘‰
38 First Missing Positive 🍎 πŸ‘‰
39 Largest Rectangle in Histogram 🍎 πŸ‘‰
40 Insert Delete GetRandom O(1) - Duplicates allowed 🍎 πŸ‘‰
41 Best Time to Buy and Sell Stock III 🍎 πŸ‘‰
42 Max Value of Equation 🍎 πŸ‘‰
Recursion
1 Pow(x, n) πŸ‹ πŸ‘‰
2 Valid Palindrome 🍏 πŸ‘‰
3 Subsets πŸ‹ πŸ‘‰
4 Permutations πŸ‹ πŸ‘‰
5 Permutations II πŸ‹ πŸ‘‰
6 Subsets II πŸ‹ πŸ‘‰
7 Combinations πŸ‹ πŸ‘‰
8 Combination Sum πŸ‹ πŸ‘‰
9 Combination Sum II πŸ‹ πŸ‘‰
10 Combination Sum III πŸ‹ πŸ‘‰
11 Letter Combinations of a Phone Number πŸ‹ πŸ‘‰
12 Partition to K Equal Sum Subsets πŸ‹ πŸ‘‰
13 Max Length of a Concatenated String with Unique Characters πŸ‹ πŸ‘‰
14 Flood Fill 🍏 πŸ‘‰
15 Word Search πŸ‹ πŸ‘‰
16 Rat in a Maze πŸ‹ πŸ‘‰
17 N Queens 🍎 πŸ‘‰
Dynamic Programming
1 Maximum Subarray πŸ‹ πŸ‘‰
2 Climbing Stairs 🍏 πŸ‘‰
3 Divisor Game 🍏 πŸ‘‰
4 Counting Bits 🍏 πŸ‘‰
5 Decode Ways πŸ‹ πŸ‘‰
6 Word Break πŸ‹ πŸ‘‰
7 Delete and Earn πŸ‹ πŸ‘‰
8 Maximal Square πŸ‹ πŸ‘‰
9 Coin Change πŸ‹ πŸ‘‰
10 Maximum Product Subarray πŸ‹ πŸ‘‰
11 Maximum Length Of Repeated Subarray πŸ‹ πŸ‘‰
12 Palindromic Substrings πŸ‹ πŸ‘‰
13 House Robber πŸ‹ πŸ‘‰
14 Continuous Subarray Sum πŸ‹ πŸ‘‰
15 Knight Dialer πŸ‹ πŸ‘‰
16 Longest Increasing Subsequence πŸ‹ πŸ‘‰
17 Unique Paths πŸ‹ πŸ‘‰
18 Count Square Submatrices with All Ones πŸ‹ πŸ‘‰
19 Range Sum Query 2D Immutable πŸ‹ πŸ‘‰
20 Longest Arithmetic Subsequence πŸ‹ πŸ‘‰
21 Trapping Rain Water 🍎 πŸ‘‰
22 Word Break II 🍎 πŸ‘‰
23 Regular Expression Matching 🍎 πŸ‘‰
24 Maximal Rectangle 🍎 πŸ‘‰
25 Longest Valid Parentheses 🍎 πŸ‘‰
26 Edit Distance 🍎 πŸ‘‰
27 Minimum Difficulty Of A Job Schedule 🍎 πŸ‘‰
28 Frog Jump 🍎 πŸ‘‰
29 Best Time To Buy And Sell Stock IV 🍎 πŸ‘‰
30 Burst Balloons 🍎 πŸ‘‰
31 Minimum Cost To Merge Stones 🍎 πŸ‘‰
32 Minimum Insertion Steps To Make A String Palindrome 🍎 πŸ‘‰
33 Super Egg Drop 🍎 πŸ‘‰
34 Count Different Palindromic Subsequences 🍎 πŸ‘‰
35 Minimum Cost To Cut A Stick 🍎 πŸ‘‰
Strings
1 Add Strings 🍏 πŸ‘‰
2 Longest Common Prefix 🍏 πŸ‘‰
3 Valid Palindrome II 🍏 πŸ‘‰
4 Roman To Integer 🍏 πŸ‘‰
5 Find the Index of the First Occurrence in a String 🍏 πŸ‘‰
6 Longest Substring Without Repeating Characters πŸ‹ πŸ‘‰
7 Minimum Remove To Make Valid Parentheses πŸ‹ πŸ‘‰
8 Longest Palindromic Substring πŸ‹ πŸ‘‰
9 Group Anagrams πŸ‹ πŸ‘‰
10 Generate Parentheses πŸ‹ πŸ‘‰
11 Basic Calculator 2 πŸ‹ πŸ‘‰
12 Integer to Roman πŸ‹ πŸ‘‰
13 Reverse Words In A String πŸ‹ πŸ‘‰
14 Simplify Path πŸ‹ πŸ‘‰
15 ZigZag Conversion πŸ‹ πŸ‘‰
16 Text Justification 🍎 πŸ‘‰
17 Integer To English Words 🍎 πŸ‘‰
18 Minimum Window Substring 🍎 πŸ‘‰
19 Valid Number 🍎 πŸ‘‰
20 Valid Number 🍎 πŸ‘‰
21 Smallest Range Covering Elements from K Lists 🍎 πŸ‘‰
22 Substring With Concatenation Of All Words 🍎 πŸ‘‰
Maths
1 Reverse Integer πŸ‹ πŸ‘‰
2 Add Binary 🍏 πŸ‘‰
3 Add Binary 🍏 πŸ‘‰
4 Palindrome Number 🍏 πŸ‘‰
5 Minimum Moves to Equal Array Elements πŸ‹ πŸ‘‰
6 Happy Number 🍏 πŸ‘‰
7 Excel Sheet Column Title 🍏 πŸ‘‰
8 Missing Number 🍏 πŸ‘‰
9 Maximum Product of Three Numbers 🍏 πŸ‘‰
10 Power of Two 🍏 πŸ‘‰
11 Encode And Decode TinyURL πŸ‹ πŸ‘‰
12 String to Integer (atoi) πŸ‹ πŸ‘‰
13 Multiply Strings πŸ‹ πŸ‘‰
14 Angle Between Hands of a Clock πŸ‹ πŸ‘‰
15 Integer Break πŸ‹ πŸ‘‰
16 Valid Square πŸ‹ πŸ‘‰
17 The kth Factor of n πŸ‹ πŸ‘‰
18 Basic Calculator 🍎 πŸ‘‰
19 Max Ponts On A Line 🍎 πŸ‘‰
20 Permutation Sequence 🍎 πŸ‘‰
21 Number of Digit One 🍎 πŸ‘‰
Greedy
1 Task Scheduler πŸ‹ πŸ‘‰
2 Gas Station πŸ‹ πŸ‘‰
3 Min Time To Make Rope Colorful πŸ‹ πŸ‘‰
4 Maximum Number of Events That Can Be Attended πŸ‹ πŸ‘‰
5 Minimum Deletions to Make Character Frequencies Unique πŸ‹ πŸ‘‰
6 Remove k digits πŸ‹ πŸ‘‰
7 Restore the Array From Adjacent Pairs πŸ‹ πŸ‘‰
8 Non Overlapping Intervals πŸ‹ πŸ‘‰
9 Candy 🍎 πŸ‘‰
10 Minimum Number of Taps to Open to Water a Garden 🍎 πŸ‘‰
11 Create Maximum Number 🍎 πŸ‘‰
Dfs
1 Letter Combinations of a Phone Number πŸ‹ πŸ‘‰
2 Course Schedule II πŸ‹ πŸ‘‰
3 Decode String πŸ‹ πŸ‘‰
4 Number of Provinces πŸ‹ πŸ‘‰
5 Clone Graph πŸ‹ πŸ‘‰
6 Shortest Bridge πŸ‹ πŸ‘‰
7 All Paths From Source to Target πŸ‹ πŸ‘‰
8 Surrounded Regions πŸ‹ πŸ‘‰
9 House Robber III πŸ‹ πŸ‘‰
10 Critical Connections in a Network 🍎 πŸ‘‰
11 Remove Invalid Parentheses 🍎 πŸ‘‰
12 Longest Increasing Path in a Matrix 🍎 πŸ‘‰
13 Concatenated Words 🍎 πŸ‘‰
14 Making A Large Island 🍎 πŸ‘‰
15 Contain Virus 🍎 πŸ‘‰
16 24 Game 🍎 πŸ‘‰
17 Remove Boxes 🍎 πŸ‘‰
Tree
1 Diameter of Binary Tree 🍏 πŸ‘‰
2 Invert Binary Tree 🍏 πŸ‘‰
3 Subtree of Another Tree 🍏 πŸ‘‰
4 Range Sum of BST 🍏 πŸ‘‰
5 Symmetric Tree 🍏 πŸ‘‰
6 Convert Sorted Array to Binary Search Tree 🍏 πŸ‘‰
7 Merge Two Binary Trees 🍏 πŸ‘‰
8 Maximum Depth of Binary Tree 🍏 πŸ‘‰
9 Binary Tree Paths 🍏 πŸ‘‰
10 Same Tree 🍏 πŸ‘‰
11 Lowest Common Ancestor of a Binary Search Tree 🍏 πŸ‘‰
12 Path Sum 🍏 πŸ‘‰
13 Minimum Absolute Difference in BST 🍏 πŸ‘‰
14 Sum of Left Leaves 🍏 πŸ‘‰
15 Balanced Binary Tree 🍏 πŸ‘‰
16 Binary Tree Inorder Traversal 🍏 πŸ‘‰
17 Count Good Nodes in Binary Tree πŸ‹ πŸ‘‰
18 Lowest Common Ancestor of a Binary Tree πŸ‹ πŸ‘‰
19 Binary Tree Right Side View πŸ‹ πŸ‘‰
19 All Nodes Distance K in Binary Tree πŸ‹ πŸ‘‰
20 Validate Binary Search Tree πŸ‹ πŸ‘‰
21 Binary Tree Zigzag Level Order Traversal πŸ‹ πŸ‘‰
22 Binary Search Tree Iterator πŸ‹ πŸ‘‰
23 Binary Tree Level Order Traversal πŸ‹ πŸ‘‰
24 Path Sum III πŸ‹ πŸ‘‰
25 Construct Binary Tree from Preorder and Postorder Traversal πŸ‹ πŸ‘‰
26 Unique Binary Search Trees πŸ‹ πŸ‘‰
27 Recover Binary Search Tree πŸ‹ πŸ‘‰
28 Populating Next Right Pointers in Each Node πŸ‹ πŸ‘‰
29 Flatten Binary Tree to Linked List πŸ‹ πŸ‘‰
30 Maximum Width of Binary Tree πŸ‹ πŸ‘‰
31 Unique Binary Search Trees II πŸ‹ πŸ‘‰
32 Kth Smallest Element in a BST πŸ‹ πŸ‘‰
33 Redundant Connection πŸ‹ πŸ‘‰
34 Serialize and Deserialize Binary Tree 🍎 πŸ‘‰
35 Binary Tree Maximum Path Sum 🍎 πŸ‘‰
36 Vertical Order Traversal of a Binary Tree 🍎 πŸ‘‰
37 Binary Tree Cameras 🍎 πŸ‘‰
38 Sum of Distances in Tree 🍎 πŸ‘‰
40 Number Of Ways To Reconstruct A Tree 🍎 πŸ‘‰
41 Redundant Connection II 🍎 πŸ‘‰
Hash Table
1 Verifying an Alien Dictionary 🍏 πŸ‘‰
2 Design HashMap 🍏 πŸ‘‰
3 Top K Frequent Elements πŸ‹ πŸ‘‰
4 Design Twitter πŸ‹ πŸ‘‰
Binary Search
1 Sqrt(x) 🍏 πŸ‘‰
2 Binary Search 🍏 πŸ‘‰
3 Count Negative Numbers in a Sorted Matrix 🍏 πŸ‘‰
4 Peak Index in a Mountain Array 🍏 πŸ‘‰
5 Time Based Key-Value Store πŸ‹ πŸ‘‰
6 Search in Rotated Sorted Array πŸ‹ πŸ‘‰
7 Pow(x, n) πŸ‹ πŸ‘‰
8 Find First and Last Position of Element in Sorted Array πŸ‹ πŸ‘‰
9 Find Peak Element πŸ‹ πŸ‘‰
10 Search a 2D Matrix πŸ‹ πŸ‘‰
11 Divide Two Integers πŸ‹ πŸ‘‰
12 Capacity To Ship Packages Within D Days πŸ‹ πŸ‘‰
13 Minimum Limit of Balls in a Bag πŸ‹ πŸ‘‰
14 Median of Two Sorted Arrays 🍎 πŸ‘‰
15 Count of Smaller Numbers After Self 🍎 πŸ‘‰
16 Max Sum of Rectangle No Larger Than K 🍎 πŸ‘‰
17 Split Array Largest Sum 🍎 πŸ‘‰
18 Shortest Subarray with Sum at Least K 🍎 πŸ‘‰
BFS
1 Number of Islands πŸ‹ πŸ‘‰
2 Rotting Oranges πŸ‹ πŸ‘‰
3 Snakes and Ladders πŸ‹ πŸ‘‰
4 Is Graph Bipartite? πŸ‹ πŸ‘‰
5 Minimum Jumps to Reach Home πŸ‹ πŸ‘‰
6 Word Ladder 🍎 πŸ‘‰
7 Word Ladder II 🍎 πŸ‘‰
8 Cut Off Trees for Golf Event 🍎 πŸ‘‰
9 Reachable Nodes In Subdivided Graph 🍎 πŸ‘‰
Two Pointers
1 Partition Labels πŸ‹ πŸ‘‰
2 Sort Colors πŸ‹ πŸ‘‰
3 Longest Repeating Character Replacement πŸ‹ πŸ‘‰
4 Maximum Number of Visible Points 🍎 πŸ‘‰
5 Subarrays with K Different Integers 🍎 πŸ‘‰
Backtracking
1 Palindrome Partitioning πŸ‹ πŸ‘‰
2 Combination Sum II πŸ‹ πŸ‘‰
3 Combinations πŸ‹ πŸ‘‰
4 Permutations II πŸ‹ πŸ‘‰
5 Subsets II πŸ‹ πŸ‘‰
6 Beautiful Arrangement πŸ‹ πŸ‘‰
7 Word Search II 🍎 πŸ‘‰
8 Sudoku Solver 🍎 πŸ‘‰
9 N-Queens 🍎 πŸ‘‰
10 Unique Paths III 🍎 πŸ‘‰
Stack
1 Min Stack πŸ‹ πŸ‘‰
2 Next Greater Element I 🍏 πŸ‘‰
3 Backspace String Compare 🍏 πŸ‘‰
4 Implement Queue using Stacks 🍏 πŸ‘‰
5 Binary Tree Preorder Traversal 🍏 πŸ‘‰
6 Binary Tree Postorder Traversal 🍏 πŸ‘‰
7 Binary Tree Inorder Traversal 🍏 πŸ‘‰
8 Implement Stack using Queues 🍏 πŸ‘‰
9 Remove All Adjacent Duplicates in String II πŸ‹ πŸ‘‰

About

250 must solve leetcode questions spanning across various dsa topics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages