You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a 4x2 matrix (array of arrays) representing the seating arrangement for a meal, determine how many seats a left-handed person can sit at.
4
+
5
+
A left-handed person cannot sit where a right-handed person would be in the seat to the immediate left of them.
6
+
In the given matrix:
7
+
8
+
An "R" is a seat occupied by a right-handed person.
9
+
An "L" is a seat occupied by a left-handed person.
10
+
An "U" is an unoccupied seat.
11
+
Only unoccupied seats are available to sit at.
12
+
The seats in the top row are facing "down", and the seats in the bottom row are facing "up" (like a table), so left and right are relative to the seat's orientation.
13
+
Corner seats only have one seat next to them.
14
+
For example, in the given matrix:
15
+
16
+
[
17
+
["U", "R", "U", "L"],
18
+
["U", "R", "R", "R"]
19
+
]
20
+
The top-left seat is cannot be sat in because there's a right-handed person to the left. The other two open seats can be sat in because there isn't a right-handed person to the left.
0 commit comments