← All tracks
Track · For students
Coding Tier 1: problem solving in Python
Read a problem properly, pick the right structure and write Python you can test, built around one small program for a college library's returns desk.
Chapters
Chapters 2 to 14 need a plan.
- 01Reading a problem before you typeLearn a routine for reading a problem before you type: restate it, work an example by hand, list edge cases, then plan, code and test, shown on FizzBuzz.About 12 minFree
- 02Lists, tuples, sets and dictionariesLearn how Python lists, tuples, sets and dictionaries hold data, then use the collections module, strings and comprehensions on one library returns-desk line.About 12 minLocked: needs a plan
- 03Functions, mutability and errorsLearn to write functions that say what they return, why a list passed in is the same list, the default argument trap, and how to handle bad input.About 12 minLocked: needs a plan
- 04Big-O, two pointers and sliding windowsRead a loop's cost with Big-O, then speed up slow code with two pointers and sliding windows and tell which pattern a problem needs.About 12 minLocked: needs a plan
- 05Hashing and stacksLearn how a dictionary trades memory for speed in counting and grouping, how a stack matches brackets, and how a monotonic stack finds the next larger value.About 12 minLocked: needs a plan
- 06Recursion and treesLearn to trust the smaller call in recursion, how backtracking chooses, explores and undoes, how to walk a tree level by level, and when a loop is better.About 12 minLocked: needs a plan
- 07Binary search and sortingLearn how binary search finds a record in about sixteen steps, how to search for a number and not a position, what sorting costs, and how to merge intervals.About 12 minLocked: needs a plan
- 08Two problems, start to finishWork two problems, a palindrome check and a best day to buy and sell, from start to finish, and see which pattern each hides and where each goes wrong.About 12 minLocked: needs a plan
- 09Counting, positions and one-pass tricksLearn three moves, counting in a dictionary, remembering what you have seen and carrying a running value, across eleven small problems on a scanner log.About 12 minLocked: needs a plan
- 10Sorted ground, pointers and growing from the middleLearn to spend what the input promises: three numbers that cancel, the widest tray, searching a rotated list and growing a palindrome from the middle.About 14 minLocked: needs a plan
- 11Chains of nodes: linked listsLearn linked lists on a hold queue: reversing a chain, slow and fast pointers, merging two sorted chains, the nth slip from the end and a palindrome check.About 12 minLocked: needs a plan
- 12Trees, part two: comparing, validating and searchingLearn five recursive tree questions: same tree, branch of a tree, still a search tree, the k-th smallest, and the closest shared ancestor.About 12 minLocked: needs a plan
- 13Bits: flags and binary arithmeticLearn to pack yes or no flags into one number and use bit tricks: the value without a partner, counting ones, reversing 32 bits and adding without a plus sign.About 12 minLocked: needs a plan
- 14Grids: rotating, walking and spreadingLearn to work with grids: rotating a square, walking a spiral, clearing rows and columns, repainting a region and following a leak, plus where each goes wrong.About 13 minLocked: needs a plan