Flatten the Seating Chart

Medium ⏱ 12 min 46% acceptance ★★★★☆ 4.3
A cinema seating chart is a list of rows, each row a list of seat labels. Write all_seats(chart) that flattens it into a single list, row by row, using a nested comprehension — no itertools, no manual loops.

Examples

Example 1
Input
all_seats([['A1', 'A2'], ['B1']])
Output
['A1', 'A2', 'B1']
Explanation

Rows are concatenated in order.

Constraints

  • Single nested list comprehension.
  • Preserve row-major order.

Topics

List Comprehensionsnested loops

Companies

MicrosoftAdobeUber

Hints

Hint 1

The for clauses nest left-to-right like normal loops.

Hint 2

[seat for row in chart for seat in row].

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.