The Mechanics of Problem-Solving
Algorithms
Array
13
283
Move ZeroesWrite Pointer Compaction
189
Rotate ArrayThree-Reversal Trick
169
Majority ElementBoyer-Moore Voting
80
Remove Duplicates from Sorted Array IILookback-2
26
Remove Duplicates from Sorted ArrayUnique Compaction
27
Remove ElementWrite Pointer Compaction
1603
Design Parking SystemCapacity Counters
1275
Find Winner on a Tic-Tac-Toe GameSigned Counters
1431
Kids With the Greatest Number of CandiesFixed Threshold
896
Monotonic ArrayTwo Direction Flags
1822
Sign of the ProductRunning Sign Flip
605
Can Place FlowersGreedy Left-to-Right Planting
1502
Arithmetic ProgressionSort and Gap Check
String
16
1071
GCD of StringsConcatenation Test and Length GCD
14
Longest Common PrefixVertical Column Scan
13
Roman to IntegerLookahead Subtraction
58
Length of Last WordReverse Scan
28
Find First OccurrenceWindow Scan
1768
Merge Strings AlternatelyInterleave and Append
151
Reverse WordsNormalize, Reverse All, Reverse Each
345
Reverse VowelsTwo-Pointer Vowel Swap
459
Repeated Substring PatternDouble, Trim, Search
709
To Lower CaseASCII Arithmetic
67
Add BinaryColumn Addition with Carry
273
Integer to English WordsScale Decomposition
68
Text JustificationGreedy Packing + Space Distribution
65
Valid NumberSingle-Pass Flag Scanner
443
String CompressionIn-Place Run-Length Encoding
6
Zigzag ConversionRow-Bouncing Simulation
Matrix
7
1672
Richest Customer WealthRow-Sum Maximum
1572
Matrix Diagonal SumPrimary + Secondary Diagonals
73
Set Matrix ZeroesIn-Place Marker Propagation
54
Spiral MatrixBoundary Shrinking
48
Rotate ImageTranspose + Reverse
36
Valid SudokuRow, Column, and Box Validation
289
Game of LifeTransitional State Encoding