You are given an n by n ( square ) grid of characters, for example:

```python
[['m', 'y', 'e'], 
 ['x', 'a', 'm'], 
 ['p', 'l', 'e']]
```

You are also given a list of integers as input, for example:

```python
[1, 3, 5, 8]
```

You have to find the characters in these indexes of the grid if you think of the indexes as:

```python
[[1, 2, 3], 
 [4, 5, 6], 
 [7, 8, 9]]
```

Remember that the indexes start from one and not zero.

Then you output a string like this:

```python
"meal"
```

All inputs will be valid.

Difficulty: introductory

Starter code:

def grid_index(grid, indexes):
	

Solutions:
def grid_index(grid, idxs):
    return ''.join(grid[x][y] for x,y in map(lambda n: divmod(n-1,len(grid)),idxs))

def grid_index(grid, indexes):
    flat = sum(grid, [])
    return "".join( flat[i-1] for i in indexes )

def grid_index(grid, indexes):
    flat = tuple(x for e in grid for x in e)
    return ''.join(flat[e-1] for e in indexes)

def grid_index(ll, indexes):
    flatten = [item for flat_list in ll for item in flat_list]
    return "".join([flatten[index-1] for index in indexes])

def grid_index(grid, indexes):
    grid = sum(grid, start=[''])
    return ''.join(grid[i] for i in indexes)

def grid_index(grid, indexes):
    l = len(grid)
    return "".join(grid[(i-1)//l][(i-1)%l] for i in indexes)

def grid_index(grid, indexes):
    new = []
    for g in grid:
        for el in g:
            new.append(el)
    return ''.join([new[i - 1] for i in indexes])

def grid_index(grid, indexes):
    unpac_lst=[value for array in grid for value in array]
    return ''.join(unpac_lst[i-1] for i in indexes)

def grid_index(grid, indexes):
    n = len(grid)
    idxs = (i - 1 for i in indexes)
    return "".join(grid[i // n][i % n] for i in idxs)

from itertools import chain

def grid_index(grid, indexes):
    linear = list(chain.from_iterable(grid))
    return ''.join(linear[q - 1] for q in indexes)