Skip to content

Array Problems

Arrays are the most fundamental data structure in programming. These problems cover traversal, manipulation, subarray patterns, sliding windows, and prefix sums — techniques that show up in almost every coding interview.

54 problems

Title Difficulty
3Sum Medium
3Sum Closest Medium
4Sum Medium
Best Time to Buy and Sell Stock Easy
Best Time to Buy and Sell Stock II Medium
Best Time to Buy and Sell Stock IV Hard
Chocolate Distribution Easy
Container With Most Water Medium
Find All Duplicates in an Array Medium
Find the Duplicate Number Easy
Game of Life Medium
Gas Station Medium
Randomized Collection with Duplicates Hard
Jump Game Medium
Largest Rectangle in Histogram Hard
Majority Element Easy
Max Value of Equation Hard
Maximum Length of Repeated Subarray Medium
Maximum of Window Minimums Hard
Maximum Points You Can Obtain from Cards Medium
Maximum Product of Three Numbers Easy
Maximum Product Subarray Medium
Merge Sorted Array Easy
Minimum Moves to Equal Array Elements Easy
Missing Number Easy
Move Zeroes Easy
Next Greater Element I Easy
Ones and Zeroes Medium
Pair with a Given Difference Easy
Partition into K Equal-Sum Subsets Hard
Permutations II Medium
Pair Arrays to Meet a Minimum Sum Easy
Combinations of R Elements Medium
Product of Array Except Self Medium
Radix Sort Medium
Remove Boxes Hard
Remove Duplicates from Sorted Array Easy
Reverse Pairs Hard
Rotate Image Medium
Search in Rotated Sorted Array Medium
Set Matrix Zeroes Medium
Sliding Window Maximum Hard
Sort Colors Medium
Sort Colors (One-Pass, Constant Space) Medium
Spiral Matrix Medium
Split Array Largest Sum Hard
Subarray Sum Equals K Medium
Subarray Sums Divisible by K Medium
Subset Sum Problem Medium
Subsets II Medium
Sum of Subarray Minimums Medium
Trapping Rain Water Hard
Two Sum Easy
Word Search Medium