Capstone 4 · Levels III to IV

The Data Detective

You are handed a dataset on the Great Migration: cities, arrival decades, population changes, and the institutions that grew from them. Your job is to answer questions nobody has written the code for yet. Which decade saw the largest movement? Which city grew fastest relative to its starting size? Which institutions appear in more than one city? Sort, filter, group, deduplicate, and search your way to answers, then present them as a written analysis rather than raw numbers.

Concepts used

All ten algorithm patternsSorting with keysGroupingDeduplicationTwo pointersBinary searchComplexity

Your dataset

At least ten city records spanning four decades, each with a nested institutions list.

Milestones

1Model each city with name, state, arrival decade, population before and after, and institutions.
2Compute absolute and percentage growth, and rank cities by each.
3Group cities by decade and report totals per decade.
4Find institutions appearing in more than one city using a set or dictionary, not nested loops.
5Implement binary search over a sorted list of decades and report the steps taken.
6Write a short analysis in comments explaining what the data shows and what it cannot show.

The graded core

The rest of this project is yours to shape. This one function is the piece everything else depends on, so it runs against hidden tests to prove it is right before you build outward.

◈ Graded Challenge

Write a function that takes a list of city records (each with city, before, and after population) and returns the name of the city with the highest PERCENTAGE growth, not the highest absolute growth. Return "none" for an empty list. Ignore any city whose before value is 0, since percentage growth is undefined there.

Name it exactly: def fastest_growing(cities):

3 visible + 2 hidden
loading editor…

Your workspace

Build the full project here. Work through the milestones in order, in both languages.

SANKOFA SANDBOX
loading editor…
Your turn → Build it in Python first, then rebuild it in JavaScript. The logic transfers, only the syntax changes.
← All projectsNext: The Sankofa Engine