Category - Leetcode Hard
-
Basic Calculator
Time: O(n) Space: O(n) -
Best Time to Buy and Sell Stock III
Time: O(n) Space: O(1) -
Binary Tree Maximum Path Sum
Time: O(h) Space: O(1) -
Burning Tree
Time: O(n) Space: O(2h) -
Cherry Pickup II
Time: O(mn2) Space: O(mn2) -
Count of Smaller Numbers After Self
Time: O(nlogn) Space: O(n) -
Course Schedule III
Time: O(nlogn) Space: O(n) -
Edit Distance
Time: O(nm) Space: O(nm) -
Find Median from Data Stream
Time: O(1) Space: O(1) -
First Missing Positive
Time: O(n) Space: O(1) -
Largest Rectangle in Histogram
Time: O(n) Space: O(n) -
Longest Cycle in Graph
Time: O(nm) Space: O(nm) -
Longest Increasing Path in a Matrix
Time: O(4mn) Space: O(mn) -
Maximal Rectangle
Time: O(nm) Space: O(m) -
Maximum Frequency Stack
Time: O(logn) Space: O(n) -
Median of Two Sorted Arrays
Time: O(log(m+n)) Space: O(1) -
Minimize Deviation in Array
Time: O(n) Space: O(n) -
Minimum Window Substring
Time: O(n+m) Space: O(n+m) -
Minimum sum partition
Time: O(n) Space: O(n) -
Palindrome Partitioning
Time: O(n2n) Space: O(n2) -
Palindrome Partitioning II
Time: O(n2) Space: O(n2) -
Partition Array for Maximum Sum
Time: O(nk) Space: O(n) -
Permutation Sequence
Time: O(n) Space: O(n) -
Reconstruct Itinerary
Time: O(1) Space: O(V2) -
Reverse Nodes in k-Group
Time: O(n) Space: O(1) -
Russian Doll Envelopes
Time: O(nlogn) Space: O(n) -
Scramble String
Time: O(2n) Space: O(m+n) -
Serialize and Deserialize Binary Tree
Time: O(h) Space: O(n) -
Set Intersection Size At Least Two
Time: O(nlogn) Space: O(1) -
Sliding Window Maximum
Time: O(n) Space: O(k) -
Split Array Largest Sum
Time: O(n2m) Space: O(nm) -
Super Egg Drop
Time: O(KlogN) Space: O(NK) -
Text Justification
Time: O(nm) Space: O(n) -
The Skyline Problem
Time: O(nlogn) Space: O(n) -
Trapping Rain Water
Time: O(n) Space: O(1) -
Valid Number
Time: O(n) Space: O(1) -
Wildcard Matching
Time: O(n+m) Space: O(m) -
Word Break II
Time: O(2n) Space: O(n) -
Word Ladder
Time: O(m2n) Space: O(m2n) -
Word Search II
Time: O(nm) Space: O(w)
Category - Leetcode Medium
-
Binary Tree Zigzag Level Order Traversal
Time: O(n) Space: O(n) -
Cheapest Flights Within K Stops
Time: O(nk) Space: O(n2k) -
Clone Graph
Time: O(n) Space: O(n) -
Coin Change
Time: O(n*amount) Space: O(amount) -
Combination Sum
Time: O(2n) Space: O(n) -
Construct Binary Tree from Preorder and Inorder Traversal
Time: O(h) Space: O(1) -
Count and Say
Time: O(n) Space: O(1) -
Course Schedule II
Time: O(V+E) Space: O(V+E) -
Decode String
Time: O(n) Space: O(n) -
Decode Ways
Time: O(n) Space: O(n) -
Detect Cycle Directed Graph
Time: O(V+E) Space: O(V) -
Detect Cycle Undirected Graph
Time: O(V+E) Space: O(V) -
Find Minimum in Rotated Sorted Array
Time: O(logn) Space: O(1) -
Find the Duplicate Number
Time: O(n) Space: O(1) -
Flatten Binary Tree to Linked List
Time: O(n) Space: O(n) -
Generate Parentheses
Time: O(4n/n√n) Space: O(4n/n√n) -
House Robber III
Time: O(n) Space: O(1) -
Insert Delete GetRandom O1
Time: O(1) Space: O(n) -
Koko Eating Bananas
Time: O(logn) Space: O(1) -
Kth Smallest Element in a BST
Time: O(h+k) Space: O(h) -
Kth Smallest Element in a Sorted Matrix
Time: O(n+m) Space: O(1) -
LRU Cache
Time: O(1) Space: O(n) -
Largest Number
Time: O(n) Space: O(n) -
Least Number of Unique Integers after K Removals
Time: O(n) Space: O(n) -
Letter Combinations of a Phone Number
Time: O(n) Space: O(n) -
Linked List Cycle II
Time: O(n) Space: O(1) -
Longest Consecutive Sequence
Time: O(n) Space: O(n) -
Longest Increasing Subsequence
Time: O(nlogn) Space: O(n) -
Longest Palindromic Substring
Time: O(n2) Space: O(n2) -
Longest Substring Without Repeating Characters
Time: O(n) Space: O(26) -
Longest Substring with at least k repeating characters
Time: O(n) Space: O(26) -
Max Area of Island
Time: O(nm) Space: O(1) -
Max Consecutive Ones III
Time: O(n) Space: O(1) -
Max Increase to Keep City Skyline
Time: O(n2) Space: O(n) -
Maximal Square
Time: O(mn) Space: O(mn) -
Maximum Product Subarray
Time: O(n) Space: O(1) -
Maximum Width of Binary Tree
Time: O(h) Space: O(1) -
Min Cost to Connect All Points
Time: O(1) Space: O(1) -
Minimum Cost for Tickets
Time: O(N) Space: O(N) -
Minimum Remove to Make Valid Parentheses
Time: O(n) Space: O(n) -
Next Permutation
Time: O(n) Space: O(1) -
Partition Equal Subset Sum
Time: O(n*sum) Space: O(sum) -
Partition Labels
Time: O(n) Space: O(1) -
Perfect Squares
Time: O(n2) Space: O(n) -
Populating Next Right Pointers in Each Node
Time: O(h) Space: O(1) -
Predict the Winner
Time: O(n2) Space: O(n) -
Recover Binary Search Tree
Time: O(n) Space: O(1) -
Remove Duplicate Letters
Time: O(n) Space: O(n) -
Remove Duplicates from Sorted List II
Time: O(n) Space: O(1) -
Remove K Digits
Time: O(n+k) Space: O(n) -
Remove Nth Node From End of List
Time: O(n) Space: O(1) -
Reorder List
Time: O(n) Space: O(1) -
Restore IP Addresses
Time: O(n3) Space: O(1) -
Reverse Linked List II
Time: O(n) Space: O(1) -
Rotate Array
Time: O(logn) Space: O(1) -
Rotate List
Time: O(n) Space: O(1) -
Score of Parentheses
Time: O(n) Space: O(n) -
Search Suggestions System
Time: O(ns) Space: O(1) -
Search a 2D Matrix
Time: O(mn) Space: O(1) -
Search in Rotated Sorted Array
Time: O(n) Space: O(n) -
Search in Rotated Sorted Array II
Time: O(n) Space: O(1) -
Set Matrix Zeroes
Time: O(n2) Space: O(1) -
Shortest Path in Binary Matrix
Time: O(1) Space: O(1) -
Sort Colors
Time: O(n) Space: O(1) -
Sort List
Time: O(nlogn) Space: O(1) -
String to Integer Atoi
Time: O(n) Space: O(1) -
Subarray Sum Equals K
Time: O(n) Space: O(n) -
Subsets
Time: O(n2n) Space: O(n) -
Swap Nodes in Pairs
Time: O(n) Space: O(1) -
Task Scheduler
Time: O(n) Space: O(1) -
Valid Sudoku
Time: O(81) Space: O(81) -
Where Will the Ball Fall
Time: O(nm) Space: O(m) -
Word Break
Time: O(n2) Space: O(n) -
Word Search
Time: O(nmw) Space: O(n) -
Zigzag Conversion
Time: O(n) Space: O(n)