You will write three small functions that judge a route by its yields.
The idea. The overall yield of a line of steps is the product of the step yields. In a convergent route the poorer branch limits the product, and the steps after the join are shared.
Your tasks.
overall(yields): the product of a list of yields, written as fractions.convergent(branch_a, branch_b, after): the smaller of the two branch yields, times the yield of the steps after the join.steps_below_half(y): the smallest number of steps at yield y that leaves less than half.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…