Solution (in English)Ā 

  • Find out how long the trip will take from take off to landing. Store it in a variable called ā€˜tripLengthā€™Ā 
  • Find out when Mary and Louise are able to leave. Store it in a variable called ā€˜leaveTimeā€™Ā 
  • Calculate leaveTime plus tripLength. Store it in a variable called ā€˜minTimeā€™
  • Find out the available landing times. Store it in a variable called ā€˜availableTimesā€™Ā 
  • Compare minTime to each availableTimeĀ 
  • If availableTime is earlier than minTime, move to the next availableTimeĀ 
  • if availableTime is equal to or later than minTime, book this time

Solution (flowchart)