Leetcode Top 150 Problems - Link
Leetcode 75 Problems - Link
- QuickSort implementation in java
- HeapSort implementation in java
- MergeSort implementation in java
- Selection Sort
- Bubble Sort
- Insertion Sort
- Sort an array of 0s, 1s and 2s | Dutch National Flag problem
- Find first and last positions of an element in a sorted array
- Sort an array according to count of set bits
- Smallest factorial number
- Rearrange numbers with constant extra space
- Merge Sorted Array
- Search in Rotated Sorted Array
- Boyer-Moore Majority Voting Algorithm/ Majority Element
- Count triplets with sum smaller than X
- Minimum Swaps to Sort
- Print all subarrays with 0 sum
- Binary Search
- Floor in a Sorted Array
- Floor/Ceil in Sorted Array
- Search Insert Position
- Find First and Last Position of Element in Sorted Array
- Number of occurrence
- Peak Element in array
- Single Element in a Sorted Array
- Search in Rotated Sorted Array
- Search in Rotated Sorted Array II
- Minimum in a Sorted and Rotated
- Find out how many times the array has been rotated
- Find Peak Element
- Find Minimum in Rotated Sorted Array
- Sqrt(x)
- Nth Root of a Number using Binary Search
- Koko Eating Bananas
- Minimum Number of Days to Make m Bouquets
- Find the Smallest Divisor Given a Threshold
- Capacity To Ship Packages Within D Days
- Median of Two Sorted Arrays
- K-th element of two Sorted Arrays
- Kth Missing Positive Number
- Aggressive cows
- Sum of Mutated Array Closest to Target
- Recursive Implementation of atoi
- Power (x,n)
- Count Good Numbers
- Letter Combinations of a Phone Number
- Permutations
- Permutations II
- Restore IP Addresses
- Generate all binary strings without consecutive 1s
- Generate Parentheses
- Print all subsequences/Power Set/Subsets
- Better String - Count distinct subsequences
- Count all subsequences with sum K - Perfect Sum Problem
- Check if there exists a subsequence with sum K
- Combination Sum
- Combination Sum II
- Combination Sum III
- Subset Sums
- Subsets II
- Rotate List
- Find first node of loop in a linked list
- Segregate even and odd nodes in a Linked List
- Remove Nth Node From End of List
- Add 2 numbers in LL
- Add 1 to a Linked List Number
- Delete the Middle Node of a Linked List
- Copy List with Random Pointer
- Delete all occurrences of a given key in a doubly linked list
- Find pairs with given sum in doubly linked list
- Max and Min with minimum number of comparison
- Peak Element
- Find Union and Intersection of two arrays
- CommonElements in Three Sorted Arrays
- Alternate positive and negative numbers
- Three way partitioning
- Find Pivot Index
- Max Consecutive Ones II
- Pascal's Triangle
- Find missing number in an array
- Longest subarray with sum K (Positives + Negatives)
- Two Sum Problem
- Two Sum II - Input Array Is Sorted
- 3-Sum Problem
- Largest subarray with 0 sum
- Longest Sub-Array with Sum K
- Majority Element - Boyer-Moore Voting Algorithm
- Majority Element II
- Missing And Repeating
- Merge two sorted arrays without extra space
- Dutch National Flag Problem - Sort an array of 0's 1's and 2's
- Next Permutation
- Kth smallest element
- Rotate Array
- Maximum Subarray or Kadane's Algorithm
- Maximum Score from Subarray Minimums
- Minimize the Heights
- Minimum number of jumps
- Count Inversions
- Reverse Pairs
- Best time to buy and Sell stock
- Count pairs with given sum
- Factorials of large numbers
- Maximum Product Subarray
- House Robber
- Product of Array Except Self
- Longest consecutive subsequence
- Trapping Rain Water
- Median of 2 sorted arrays of equal size
- Median of 2 sorted arrays of different size
- Not a subset sum
- Set Matrix Zeroes
- Rotate Matrix by 90 degrees
- Spiral Matrix
- Subarray Sum Equals K
- Longest K unique characters substring
- Shuffle String
- Look and Say Pattern
- Remove all consecutive duplicates from the string
- Count Binary Substrings
- Letter Combinations of a Phone Number
- Longest Repeating Subsequence
- Word Search
- Roman Number to Integer and vice versa
- Print Anagrams Together
- Isomorphic Strings
- Remove outermost Parentheses
- String to Integer (atoi)
- Sort Characters By Frequency
- Minimum Add to Make Parentheses Valid
- Count and Say
- Add Strings
-
Check if the given string is shuffled substring of another string
-
Transform One String to Another using Minimum Number of Given Operation
- Minimum characters to be added at front to make string palindrome
- Recursively remove all adjacent duplicates
- Spirally traversing a matrix
- Search a 2D Matrix
- Row with max 1s
- Sort the given 2D Matrix
- Diagonal Traverse
- Implement Stack using array
- Implement Queue using array
- Implement Stack using Linked List
- Implement Queue using Linked List
- Implement Queue using Stacks
- Implement Stack using Queues
- Implement Circular Queue
- Valid Parentheses
- Get minimum element from stack in O(1) time
- Expression contains redundant bracket or not
- Daily Temperatures
- Keys and Rooms
- Convert Infix to Postfix
- Prefix to Infix Conversion
- Prefix to Postfix Conversion
- Postfix to Prefix Conversion
- Postfix to Infix Conversion
- Convert Infix to Prefix
- Monotonic → elements are in specific order (increasing/decreasing/any other order)
- Next Greater Element
- Next Greater Element II
- Nearest Smaller Element
- Number of NGEs to the right
- Sum of Subarray Minimums
- Trapping Rain Water
- Sum of Subarray Ranges
- Remove K Digits
- Largest Rectangle in Histogram
- BFS - Number of Islands
- 🔥 BFS - Open the Lock
- Design a stack with operations on middle element
- 🔥 Validate Stack Sequences
- 🔥 Valid Substring
- Inorder Traversal (Iterative)
- 🔥 Decode String
- 🔥 01 Matrix
- Online Stock Span
- The Celebrity Problem
- LRU Cache
- Ternary Expression Parser
- Height of a Binary Tree/Maximum depth of binary tree
- Balanced Binary Tree
- Diameter of Binary Tree
- Same Tree
- Preorder, Inorder, and Postorder Traversal
- Binary Tree Level Order Traversal
- Root Equals Sum of Children
- Binary Tree Maximum Path Sum
- ZigZag Level Order Traversal
- Boundary Traversal of binary tree
- Vertical Order Traversal of a Binary Tree
- Top View of Binary Tree
- Bottom View of Binary Tree
- Binary Tree Right Side View
- Symmetric Tree
- Longest Univalue Path
- Sum Root to Leaf Numbers
- Minimum Height Trees
- Tree Diameter
- Diameter of N-Ary Tree
- Root to Leaf Paths
- Lowest Common Ancestor of a Binary Tree
- Maximum Width of Binary Tree
- All Nodes Distance K in Binary Tree
- Requirements needed to construct a Unique Binary Tree | Theory
- Flatten Binary Tree to Linked List
- Construct Binary Tree from Preorder and Inorder Traversal
- Construct Binary Tree from Inorder and Postorder Traversal
- Serialize and Deserialize BST
- Check for BST
- Search in a Binary Search Tree
- Floor Binary Search Tree
- Ceil Binary Search Tree
- Insert a given Node in Binary Search Tree
- Predecessor and Successor
- Delete Node in a BST
- Kth Smallest Element in a BST
- Validate Binary Search Tree
- Lowest Common Ancestor of a Binary Search Tree
- Construct Binary Search Tree from Preorder Traversal
- [Binary Search Tree Iterator]
- Two Sum In BST | Check if there exists a pair with Sum K
- Implementation of a Heap
- Implementation of Priority Queue using Binary Heap
- Does array represent Heap
- Convert Min Heap to Max Heap
- Binary Heap Operations
- Kth Largest Element in an Array
- Kth smallest element in an array
- Kth Largest Element in a Stream
- K largest elements
- Find K Closest Elements
- Nearly sorted
- Merge k Sorted Arrays
- Merge k Sorted Lists
- Top K Frequent Elements
- Replace elements by its rank in the array
- Hand of Straights
- Reorganize String
- Find K Pairs with Smallest Sums
- K Closest Points to Origin
- Meeting Rooms II
- Task Scheduler
- Count Occurrences of Anagrams
- Max Sum Subarray of size K
- First negative in every window of size k
- Minimum Size Subarray Sum
- Longest Substring Without Repeating Characters
- 🔥Sliding Window Maximum/K Sized Subarray Maximum
- 🔥Longest Sub-Array with Sum K
- Subarray Sum Equals K
- Longest K unique characters substring
- Max Consecutive Ones III
- Fruit Into Baskets
- Longest Repeating Character Replacement
- Binary Subarrays With Sum
- Count Number of Nice Subarrays
- Number of Substrings Containing All Three Characters
- Maximum Points You Can Obtain from Cards
- Container With Most Water
- Find All Anagrams in a String
- Assign Cookies
- Fractional Knapsack
- Lemonade Change
- Minimum number of Coins
- N meetings in one room
- Shortest Job first
- Minimum Domino Rotations For Equal Row
- 🔥Valid Parenthesis String
- Jump Game
- Jump Game-II
- Minimum number of platforms
- Job Sequencing Problem
- Candy Count
- Insert Interval
- Merge Intervals
- Non-overlapping Intervals
- Minimum Number of Arrows to Burst Balloons
- Gas Station
- Introduction to DP
- Climbing Stairs
- Min Cost Climbing Stairs
- Frog Jump
- Frog Jump with k Distances/Minimal Cost
- House Robber/Maximum sum of non-adjacent elements
- House Robber II
- Perfect Square
- Geek's Training - 2D_DP
- Grid Unique Paths : DP on Grids
- Unique Paths II
- Minimum Path Sum
- Minimum Falling Path Sum
- 3-d DP : Chocolates Pickup
- Subset Sum Problem
- Partition Equal Subset Sum
- Partition Array Into Two Arrays to Minimize Sum Difference
- Perfect Sum Problem/Count Subsets with Sum K
- Partitions with Given Difference
- Coin Change
- Target Sum
- Coin Change II
- Knapsack with Duplicate Items
- Rod Cutting
- Maximum Alternating Subsequence Sum
- Minimum Cost For Tickets
- Longest Common Subsequence
- Print Longest Common Subsequence
- Longest Common Substring
- Longest Palindromic Subsequence
- Minimum insertions to make string palindrome
- Delete Operation for Two Strings
- Shortest Common Supersequence
- Edit Distance
- Wildcard Matching
- Longest Palindrome in a String
- Minimum Operations
- Minimum number of Coins
- Longest Common Substring
- Longest Increasing Subsequence
- Max length chain
- Coin Change_Minimum Coins to Make Sum-I
- Graph and its representations
- DFS - Adjacency Matrix Representation
- DFS - Adjacency List Representation
- BFS - Adjacency Matrix Representation
- BFS - Adjacency List Representation
- Flood Fill
- Connected Components
- Number of Provinces
- Island Perimeter
- Rotting Oranges
- Detect Cycle in an Undirected Graph - BFS & DFS Approach
- Detect Cycle in a Directed Graph - DFS
- 01 Matrix
- Number of Enclaves
- Surrounded Regions
- Is Graph Bipartite?
- Bridges in Graph
- Bipartite Graph
- Snakes and Ladders
- Topological Sort Algorithm
- Kahn's Algorithm
- Cycle Detection in Directed Graph (BFS)
- Course Schedule-I
- Course Schedule-II
- Find Eventual Safe States
- Shortest Path in UG with unit weights
- Shortest path in Directed Acyclic Graph
- 0-1 BFS
- Djisktra's Algorithm
- Bellman Ford Algorithm
- Shortest Path in Binary Matrix
- Path With Minimum Effort
- Floyd Warshall Algorithm
- Minimum Spanning Tree | Prim’s Minimum Spanning Tree Algorithm
- Disjoint Set | Union by Rank and Path
- Kruskal’s Minimum Spanning Tree Algorithm
- Number of Operations to Make Network Connected