Topic
Array problems
437 problems: 148 easy, 230 medium, 59 hard.
Easy (148)
- Two Sum
- Fizz Buzz
- Merge Two Sorted Arrays
- Contains Duplicate
- Best Time to Buy and Sell Stock
- Missing Number
- Single Number
- Move Zeroes
- Reverse String
- Linked List Cycle
- Binary Search
- Remove Duplicates from Sorted Array
- Plus One
- Longest Common Prefix
- Remove Element
- Search Insert Position
- Intersection of Two Arrays
- Majority Element
- Reverse Linked List
- Last Stone Weight
- Plus One (Large Number)
- Missing Number (XOR)
- Next Greater Element I
- Set Mismatch
- Min Cost Climbing Stairs
- Logger Rate Limiter
- Range Sum Query - Immutable
- Counting Bits
- Design HashMap
- Shuffle String
- Divide Array Into Equal Pairs
- Check if Array Is Sorted and Rotated
- Sort Integers by The Number of 1 Bits
- Kth Missing Positive Number
- Can Make Arithmetic Progression From Sequence
- Find Lucky Integer in an Array
- Sort Array By Parity
- Total Time Covered
- Array Partition
- Longest Harmonious Subsequence
- Range Addition II
- Minimum Index Sum of Two Lists
- Check If N and Its Double Exist
- Valid Mountain Array
- Defuse the Bomb
- Count Items Matching a Rule
- Count the Number of Consistent Strings
- Check If Two String Arrays are Equivalent
- Maximum Population Year
- Find the Highest Altitude
- Sum of Unique Elements
- Count Good Triplets
- Find Pivot Index
- Largest Number At Least Twice Others
- Third Maximum Number
- Relative Sort Array
- Squares of a Sorted Array
- Intersection of Two Arrays II
- First Bad Version
- Meeting Rooms
- Merge Sorted Array
- Find Kth Largest in Stream
- Design HashSet
- Find Winner on Tic Tac Toe
- Contains Duplicate II
- Maximum Average Subarray I
- Degree of an Array
- Largest Subarray Length K
- Replace Elements with Greatest on Right
- Maximum Ascending Subarray Sum
- Running Sum of 1d Array
- Richest Customer Wealth
- Number of Rectangles That Can Form Largest Square
- Monotonic Array
- Kids With the Greatest Number of Candies
- Shuffle the Array
- Final Prices With a Special Discount
- Design Parking System
- Minimum Absolute Difference
- How Many Numbers Are Smaller Than Current
- Create Target Array in Given Order
- Three Consecutive Odds
- Can Make Arithmetic Progression
- Find Numbers with Even Number of Digits
- Sum of All Odd Length Subarrays
- Find Closest Number to Zero
- Element Appearing More Than 25% In Sorted Array
- Count Equal and Divisible Pairs in Array
- Number of Recent Calls
- Largest Local Values in a Matrix
- Find the Difference of Two Arrays
- Unique Number of Occurrences
- Maximum Value of a String in an Array
- Number of Good Pairs
- Decode XORed Array
- Transpose Matrix
- Find Common Characters
- Destination City
- Sort Array By Parity II
- Sort Integers by Number of 1 Bits
- Make Two Arrays Equal by Reversing
- Left and Right Sum Differences
- Increasing Order Search Tree
- Minimum Subsequence in Non-Increasing Order
- Convert Temperature
- How Many Numbers Are Smaller
- Find Target Indices After Sorting Array
- Final Value of Variable After Operations
- Maximum Number of Words in a Sentence
- Count Equal and Divisible Pairs
- Merge Similar Items
- Count Prefixes of a Given String
- Divide a String Into Groups of Size k
- Most Frequent Even Element
- Sign of the Product of an Array
- Count Elements With Strictly Smaller and Greater Elements
- Delete Columns to Make Sorted
- Relative Ranks
- Special Array With X Elements >= X
- Squares of Sorted Array
- Flood Fill
- Keyboard Row
- Find Words Formed by Characters
- Add to Array-Form of Integer
- Merge Two Binary Trees
- Average of Levels in Binary Tree
- N-ary Tree Preorder Traversal
- N-ary Tree Postorder Traversal
- Convert Sorted Array to BST
- Max Consecutive Ones
- Most Common Word
- Two Sum Less Than K
- Increasing BST Order
- Find All Numbers Disappeared in an Array
- Two Out of Three
- Array Pair Sum
- Count Even Numbers
- Sum of Even Numbers
- Count Positive Numbers
- Count Negative Numbers
- Array Maximum
- Array Minimum
- Second Largest Value
- Count Distinct Values
- Reverse Array
- Running Maximum
- Rotate Array Right
- Move Zeros to End
Medium (230)
- Maximum Subarray
- Product of Array Except Self
- Rotate Array
- House Robber
- Merge Intervals
- 3Sum
- Container With Most Water
- Group Anagrams
- Coin Change
- Set Matrix Zeroes
- Jump Game
- Subsets
- Permutations
- Letter Combinations of a Phone Number
- Generate Parentheses
- Course Schedule
- Longest Increasing Subsequence
- Find Minimum in Rotated Sorted Array
- Search in Rotated Sorted Array
- Top K Frequent Elements
- Kth Largest Element in an Array
- Binary Tree Level Order Traversal
- Construct Binary Tree from Preorder and Inorder Traversal
- Implement Trie (Prefix Tree)
- Min Stack
- Combination Sum
- Partition Equal Subset Sum
- Daily Temperatures
- Sort Colors
- Find Peak Element
- Task Scheduler
- 4Sum
- Next Permutation
- Rotate Image
- Maximum Product Subarray
- Longest Consecutive Sequence
- Meeting Rooms II
- Insert Interval
- Non-overlapping Intervals
- Find K Closest Elements
- Maximum Sum Circular Subarray
- Wiggle Sort II
- Increasing Triplet Subsequence
- Top K Frequent Words
- Encode and Decode Strings
- Two Sum II - Input Array Is Sorted
- 3Sum Closest
- Minimum Size Subarray Sum
- Find First and Last Position of Element
- Search in Rotated Sorted Array II
- K Closest Points to Origin
- Subsets II
- Surrounded Regions
- Walls and Gates
- Course Schedule II
- House Robber II
- Coin Change II
- Target Sum
- Maximum Subarray with Jump
- Jump Game II
- Merge Intervals II
- Rotate Image 180
- Spiral Matrix II
- Set Matrix Zeroes (Constant Space)
- Reorder List
- Serialize and Deserialize BST
- Construct BST from Preorder Traversal
- Next Greater Element II (Circular)
- Asteroid Collision
- Online Stock Span
- String Compression
- Design Twitter
- Find the Duplicate Number
- Delete and Earn
- Best Time to Buy and Sell Stock with Cooldown
- Best Time to Buy and Sell Stock with Transaction Fee
- Find a Peak Element II (2D)
- Snapshot Array
- Zigzag Iterator
- Range Sum Query - Mutable
- Shuffle an Array
- Insert Delete GetRandom O(1)
- Flatten Nested List Iterator
- Construct Binary Tree from Inorder and Postorder
- Populating Next Right Pointers in Each Node
- Inorder Successor in BST
- Trim a Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Sum of Subarray Minimums
- Single Number II
- Single Number III
- Maximum XOR of Two Numbers in an Array
- Super Ugly Number
- Game of Life
- Copy List with Random Pointer
- Sort List
- Flatten a Multilevel Doubly Linked List
- Design Circular Queue
- Subarray Sum Equals K
- Flatten Binary Tree to Linked List
- Distribute Coins in Binary Tree
- Number of Longest Increasing Subsequence
- Find And Replace in String
- Boats to Save People
- Advantage Shuffle
- Prison Cells After N Days
- Find K Pairs with Smallest Sums
- Peak Index in a Mountain Array
- Random Pick with Weight
- Random Pick Index
- Linked List Random Node
- Random Point in Non-overlapping Rectangles
- Exam Room
- RLE Iterator
- Fruit Into Baskets
- Max Consecutive Ones III
- Longest Turbulent Subarray
- Split Array into Consecutive Subsequences
- Hand of Straights
- Reveal Cards In Increasing Order
- Distant Barcodes
- Maximum Points You Can Obtain from Cards
- Find All Duplicates in an Array
- Minimum Moves to Equal Array Elements II
- Array Nesting
- Minimum Operations to Make Median
- Largest Sum of Averages
- Number of Subarrays with Bounded Maximum
- Smallest Range II
- Longest Nice Subarray
- Maximize Win From Two Segments
- XOR Queries of a Subarray
- Count Number of Nice Subarrays
- Max Number of K-Sum Pairs
- Reduce Array Size to The Half
- Furthest Building You Can Reach
- Maximum Distance in Arrays
- Longest Word in Dictionary through Deleting
- Contiguous Array
- Find Right Interval
- Predict the Winner
- Subarray Product Less Than K
- Majority Element II
- Remove Nth Node From End
- Rotate List
- Construct Binary Tree from Preorder and Inorder
- Merge Triplets to Form Target
- Triangle
- Longest Arithmetic Subsequence
- Uncrossed Lines
- Min Cost to Connect All Points
- Min Stack Operations
- Design Tic-Tac-Toe
- Maximum Sum of Distinct Subarrays With Length K
- Non-decreasing Array
- Bag of Tokens
- Maximum Erasure Value
- Number of Subarrays with Sum
- Minimum Operations to Reduce X to Zero
- Find the Most Competitive Subsequence
- Build an Array With Stack Operations
- 132 Pattern
- Shortest Unsorted Continuous Subarray
- Number of Zero-Filled Subarrays
- Count Subarrays With Max Element Appearing K Times
- Avoid Flood in The City
- Count Vowel Strings in Ranges
- Sum of XOR
- Delete Node in Linked List
- Rearrange Array Elements by Sign
- Find All Lonely Numbers
- Find Original Array From Doubled
- Minimize Maximum of Array
- Minimum Moves to Equal Array Elements
- Search Suggestions System
- Single Element in Sorted Array
- Longest Subarray of 1s After Deleting One Element
- Construct BST from Preorder
- Triangle Minimum Path Sum
- Total Hamming Distance
- Design Linked List
- Convert Sorted List to BST
- K-diff Pairs in an Array
- Maximum Width Ramp
- N-ary Tree Level Order
- Short Encoding of Words
- Reorder Data in Log Files
- Longest Word in Dictionary
- Maximum Binary Tree
- Print Binary Tree
- H-Index
- H-Index II
- Range Frequency Queries
- Split Linked List in Parts
- Number of Matching Subsequences
- Longest Palindrome by Concatenating Two Letter Words
- Global and Local Inversions
- Max Chunks To Make Sorted
- Shifting Letters
- Arithmetic Slices
- Optimal Division
- Brick Wall
- Reverse Words in a String II
- Valid Triangle Number
- Add One Row to Tree
- Find All Duplicates in Array
- Continuous Subarray Sum
- Longest Uncommon Subsequence II
- Delete Nodes And Return Forest
- Count Nodes With the Highest Score
- Verify Preorder Sequence in BST
- Flip Binary Tree To Match Preorder
- Binary Search Tree to Greater Sum Tree
- Maximum Average Subtree
- Linked List in Binary Tree
- Convert Binary Search Tree to Sorted Doubly Linked List
- Node With Highest Edge Score
- Closest Nodes Queries in a Binary Search Tree
- Count Pairs in Two Arrays
- Maximum Score from Performing Multiplication Operations
- Stone Game VII
- Time Needed to Inform All Employees
- Length of Longest Fibonacci Subsequence
- Binary Subarrays With Sum
- Ways to Split Array Into Three Subarrays
- Remove Duplicates from Sorted Array II
- Minimum Rotations to Sort
- Count Pairs Divisible by K
- Two City Scheduling
- Count Inversions
Hard (59)
- Median of Two Sorted Arrays
- Merge k Sorted Lists
- Sliding Window Maximum
- Largest Rectangle in Histogram
- Serialize and Deserialize Binary Tree
- First Missing Positive
- Candy
- Sudoku Solver
- Text Justification
- Max Points on a Line
- Longest Consecutive Sequence II
- Minimum Interval to Include Each Query
- Matrix Chain Multiplication
- Count Subarrays With Fixed Bounds
- Split Array Largest Sum
- Count of Smaller Numbers After Self
- Create Maximum Number
- Concatenated Words
- Best Time to Buy and Sell Stock IV
- Sliding Window Median
- Count of Range Sum
- Maximum Profit in Job Scheduling
- Minimum Cost to Merge Stones
- Vertical Order Traversal of a Binary Tree
- Arithmetic Slices II - Subsequence
- IPO
- Maximum Performance of a Team
- Find K-th Smallest Pair Distance
- Minimize Max Distance to Gas Station
- Stream of Characters
- Subarrays with K Different Integers
- Minimum Cost to Hire K Workers
- Self Crossing
- Patching Array
- Count Subarrays With Score Less Than K
- Shortest Subarray with Sum at Least K
- K Inverse Pairs Array
- Optimal Account Balancing
- Smallest Sufficient Team
- Max Value of Equation
- Stamping The Sequence
- Max Chunks To Make Sorted II
- Minimize Deviation in Array
- Contains Duplicate III
- Constrained Subsequence Sum
- Number of Ways to Stay in the Same Place
- Find Array Given Subset Sums
- Find Minimum in Rotated Sorted Array II
- Split Array With Same Average
- Sum of Distances in Tree
- Find the Shortest Superstring
- Tallest Billboard
- Serialize and Deserialize N-ary Tree
- Make Array Strictly Increasing
- Minimum Money Required Before Transactions
- Maximum Segment Sum After Removals
- Maximum Score Words Formed by Letters
- Three Stack Equal Sum
- Maximum Circular Subarray Product