Flight menu combinations
A tasting counter builds a flight from its printed menu, where dish_names[i] is a dish and stations[i] is the kitchen station that cooks it. A flight takes exactly flight_size dishes, keeps them in menu order, and never uses the same station twice, because one station cannot plate two courses in the same service. Return every possible flight as a string: the chosen dish names joined by a plus sign padded with single spaces, so two dishes read as "miso egg + yuzu tart". List the flights in the order a left to right scan of the menu finds them, so a flight whose first dish sits earlier on the menu comes first, and ties break on the next dish chosen. Return an empty list when no flight fits. The menu holds at most 8 dishes and flight_size is at least 1.
build_tasting_flight(dish_names: list[str], stations: list[str], flight_size: int) → list[str][["miso egg","chili crab","yuzu tart"],["grill","wok","pastry"],2]out["miso egg + chili crab","miso egg + yuzu tart","chili crab + yuzu tart"][["miso egg","charred leek","yuzu tart"],["grill","grill","pastry"],2]out["miso egg + yuzu tart","charred leek + yuzu tart"][["miso egg","chili crab"],["grill","wok"],1]out["miso egg","chili crab"]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
[["miso egg","chili crab","yuzu tart"],["grill","wok","pastry"],2]["miso egg + chili crab","miso egg + yuzu tart","chili crab + yuzu tart"]not run yetsample[["miso egg","charred leek","yuzu tart"],["grill","grill","pastry"],2]["miso egg + yuzu tart","charred leek + yuzu tart"]not run yetsample[["miso egg","chili crab"],["grill","wok"],1]["miso egg","chili crab"]not run yetsample