runtime
68 / 500
question 68 Lists & Tuples · medium

Double-booked seats

A cinema's booking system received these seat bookings, each a (row, seat) tuple. A seat booked more than once is double-booked. Print each double-booked seat once, in the order its second booking arrives, as a list. If no seat is double-booked, print no double bookings.

Inputbookings, a list of (row, seat) tuples
Printsa list of the double-booked seats, each once, in the order they are found; or no double bookings
Same seatthe same row number and the same seat letter: (12, "A") and (12, "B") are different seats
Examplesthe starter's bookings → [(12, 'A'), (3, 'C')]; [(1, "A")] → no double bookings
Expected output1 line
  1. 1[(12, 'A'), (3, 'C')]

Loading your progress…

Double-booked seats — Python practice · Runtime