<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightArrayschevron_rightPatterns
code

ARRAYS · CATEGORY

LeetCode Patterns

Classic interview problems that turn the array techniques into solutions.

Choose a problem

show_chartarrow_outward

Maximum Subarray

Kadane: largest contiguous sum (#53).

O(n)O(1)◍ 0/5
trending_uparrow_outward

Buy & Sell Stock

Best single buy/sell profit (#121).

O(n)O(1)◍ 0/5
exposure_zeroarrow_outward

Move Zeroes

Push 0s to the end, keep order (#283).

O(n)O(1)◍ 0/5
waterarrow_outward

Container With Most Water

Two-pointer max area (#11).

O(n)O(1)◍ 0/5
palettearrow_outward

Sort Colors

Dutch flag — 0/1/2 in one pass (#75).

O(n)O(1)◍ 0/5
filter_altarrow_outward

Remove Duplicates

Unique prefix of a sorted array (#26).

O(n)O(1)◍ 0/5
how_to_votearrow_outward

Majority Element

Boyer–Moore voting (#169).

O(n)O(1)◍ 0/5