Templates
Every pattern’s Python skeleton on one sheet, with the spans that change from problem to problem boxed and numbered.
Should I memorise these templates?
Memorise the skeleton, and understand the slots. Each template is ten to thirty lines where two to four spans change per problem. If you can type the skeleton without thinking and you know what each slot stands for, a new problem becomes a question of what to put in the slots. Memorising without the derivation fails under follow-up questions, which is why every template links to the page that derives it.
Are these templates tested?
Yes. Each one is a real Python file with its own test cases, and the site is built from those files. The code on this page is the code the tests ran.