/fraz-leetcode-hot-250

250 must solve leetcode questions spanning across various dsa topics.

Primary LanguagePython

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 🍋 👉