Create a function that takes in the size of the line and the number of people waiting and places people in an S-shape ordering. The demonstration below will make it clear:
# Ordering numbers 1-15 in a [5,3] space.
order_people([5, 3], 15) ➞ [
[1, 2, 3],
[6, 5, 4],
[7, 8, 9],
[12, 11, 10],
[13, 14, 15]
]
If there is extra room, leave those spots blank with a 0 filler.
# Ordering numbers 1-5 in a [4, 3] space.
order_people([4, 3], 5) ➞ [
[1, 2, 3],
[0, 5, 4],
[0, 0, 0],
[0, 0, 0]
]
If there are too many people for the given dimensions, return "overcrowded".
order_people([4, 3], 20) ➞ "overcrowded"
order_people([3, 3], 8) ➞ [
[1, 2, 3],
[6, 5, 4],
[7, 8, 0]
]
order_people([2, 4], 5) ➞ [
[1, 2, 3, 4],
[0, 0, 0, 5]
]
order_people([2, 4], 10) ➞ "overcrowded"