# breaking it down medium

The Savings Race

Your rich cousin has a head start, but you save faster. When do you finally pass them? 🏦

You get your start and weekly rate, then cousin's cstart and crate (you're behind but faster). Print the first week number (1, 2, 3…) when your total is strictly bigger.

Example:

Input: start = 0, rate = 10, cstart = 50, crate = 5 Output: 11

Your total grows by 10 a week; your cousin's grows by 5 a week starting 50 ahead. By week 11 you've saved 110 versus the cousin's 50 + 55 = 105 — finally ahead.

💡 need a hint?

brk-savings-race.py🔒 given lines are locked — write your code in between
loading...