A startup office has an ongoing problem with its bin. Due to low budgets, they don't hire cleaners. As a result, the staff are left to voluntarily empty the bin. It has emerged that a voluntary system is not working and the bin is often overflowing. One staff member has suggested creating a rota system based upon the staff seating plan.

Create a function `binRota` that accepts a 2D array of names. The function will return a single array containing staff names in the order that they should empty the bin. 

Adding to the problem, the office has some temporary staff. This means that the seating plan changes every month. Both staff members' names and the number of rows of seats may change. Ensure that the function `binRota` works when tested with these changes. 

**Notes:**
- All the rows will always be the same length as each other.
- There will be no empty spaces in the seating plan.
- There will be no empty arrays.
- Each row will be at least one seat long.

An example seating plan is as follows:

![](http://i.imgur.com/aka6lh0l.png)

Or as an array: 
```
[ ["Stefan", "Raj",    "Marie"],
  ["Alexa",  "Amy",    "Edward"],
  ["Liz",    "Claire", "Juan"],
  ["Dee",    "Luke",   "Katie"] ]
```

The rota should start with Stefan and end with Dee, taking the left-right zigzag path as illustrated by the red line:



As an output you would expect in this case:

```
["Stefan", "Raj", "Marie", "Edward", "Amy", "Alexa", "Liz", "Claire", "Juan", "Katie", "Luke", "Dee"])
```

Source: codewars | Difficulty: EASY
Tags: Matrices

Fundamentals

Data structures

Starter code: def binRota(arr):
	

Solutions:
def binRota(arr):
	return [name for (i, row) in enumerate(arr) for name in row[::-1 if i % 2 else 1]]


def binRota(arr):
	rota = []
	for (i, row) in enumerate(arr):
		if i % 2:
			row = reversed(row)
		rota.extend(row)
	return rota


def binRota(arr):
	res = []
	for i in range(len(arr)):
		res.extend(arr[i][::(-1) ** i])
	return res


def binRota(arr):
	return [y for x in arr for y in (x, x[::-1])[arr.index(x) % 2]]


def binRota(arr):
	return [seat for (row, seats) in enumerate(arr) for seat in seats[::(-1) ** row]]


def binRota(arr):
	res = []
	for i in range(len(arr)):
		if i % 2 == 1:
			res.extend(arr[i][::-1])
		else:
			res.extend(arr[i])
	return res


def binRota(arr):
	return list(office(arr))

def office(arr):
	w = 0
	for e in arr:
		yield from e[::[1, -1][w]]
		w = not w


binRota = lambda a: [p for (i, l) in enumerate(a) for p in l[::1 - i % 2 * 2]]


def binRota(arr):
	arr[1::2] = map(lambda x: x[::-1], arr[1::2])
	return sum(arr, [])