Algorithm Foundations: Arrays, Searching, Sorting, and Hashing Python lessons
Complexity, linear and binary search, sorted() trade-offs, prefix ideas, two pointers, sliding windows, and hash-map patterns.
Core concepts
Problem-solving patterns
- search
- binary search
- binary search · boundary
- bubble sort
- insertion sort
What this topic builds
Learn the idea once, trace it through two verified cases, then explain why your approach works.
All 19 lessons in this topic
Work from top to bottom to build each concept gradually.
- #091Perform linear searchBeginnerPremium
Locate the first occurrence of a code in an unsorted list.
- #092Perform iterative binary searchIntermediatePremium
Locate a target in a sorted record list.
- #093Find first and last occurrenceIntermediatePremium
Find the full index range occupied by a repeated target.
- #094Sort with bubble sortIntermediatePremium
Sort a small list to practice adjacent swaps.
- #095Sort with insertion sortAdvancedPremium
Sort a nearly ordered list, a good case for insertion sort.
- #096Merge overlapping intervalsAdvancedPremium
Merge overlapping meeting time blocks.
- #097Build product except selfAdvancedPremium
For every position, multiply all other values.
- #098Find the majority elementInterview-LevelPremium
Find the value occurring in more than half of the list.
- #099Find longest substring without repeatsInterview-LevelPremium
Find the longest unique-character window in a common example.
- #100Maximize one stock transactionInterview-LevelPremium
Find the best profit from exactly one buy followed by one later sale.
- #101Find unique three-sum tripletsInterview-LevelPremium
List all unique triples whose sum is zero.
- #102Maximize water between linesInterview-LevelPremium
Find the largest container area formed by two vertical lines.
- #103Calculate trapped rain waterInterview-LevelPremium
Calculate total water trapped after rain across varied bars.
- #104Find the longest consecutive runInterview-LevelPremium
Find the length of the longest consecutive sequence without sorting.
- #105Rotate a square matrix clockwiseInterview-LevelPremium
Rotate a small image matrix 90 degrees clockwise.
- #106Read a matrix in spiral orderInterview-LevelPremium
Return a rectangular matrix in clockwise spiral order.
- #107Set matrix rows and columns to zeroInterview-LevelPremium
Zero the complete row and column containing an original zero.
- #108Count subarrays with target sumInterview-LevelPremium
Count every contiguous subarray whose sum equals the target.
- #109Find the minimum covering windowInterview-LevelPremium
Find the shortest source substring containing every required character with multiplicity.