Solution in English
- Find out(input) how much did it delayed. Store it in a variable called delayedLength.
- Find out(input) when can Mary leave. Store it in a variable called leaveTime.
- Calculate leaveTime plus delayedLength. Store it in a variable called minTime.
- Find out(input) the available alternate leaving times that adds 20 minutes. Store it in a variable called alternateTimes20.
- Find out(input) the available alternate leaving times that adds 45 minutes. Store it in a variable called alternateTimes45.
- Compare minTime to each of both alternativeTimes20 and alternativeTimes45.
- If alternateTime20 is earlier than minTime, move on to the next alternateTime.
- If alternateTime45 is earlier than minTime, move on to the next alternateTime.
- If alternateTime20 is equal or later than minTime, choose this time as an alternative.
- If alternateTime45 is equal or later than minTime, choose this time as an alternative.
mwilson
Close, but not quite.
Here is my version: https://docs.google.com/document/d/1Mv4ZhDj3SjXL3M5hE1gY2XjY9Kb_1EUrU0-dg3abN14/edit?usp=sharing