In a flight booking app, users are asked to enter their departure airport, destination airport, departure date, return date, number of adults and number of children.
Passengers are allocated an available seat. A data structure named seats is used to store whether each seat is available (true) or unavailable (false).
The pseudocode design shows how an available seat is allocated.
Which piece of code correctly implements this design?