Math Fundamentals18 sections · 814 units
Open in Course

Lessons from Fizz Buzz

summary

Two lessons:

1.1. Order of conditions matters. Check the most specific case first (divisible by both) before less specific cases (divisible by one).

2.2. If aa divides nn and bb divides nn, then a×ba \times b divides nn (when aa and bb are coprime). This lets you combine checks.