In this kata you are expected to recover a scattered password in a (m x n) grid (you'll be given directions of all password pieces in the array)
The array will contain pieces of the password to be recovered, you'll get directions on how to get all the the pieces, your initial position in the array will be the character "x".
Heres what the array looks like
The given directions would consist of `[left, right, up, down]` and `[leftT, rightT, upT, downT]`, the former would be used to move around the grid while the latter would be used when you have a password to that direction of you.(
**E.g** if you are in a position and the move to make is `leftT` it means theres a password to the left of you, so take the value and move there)
So in the 2d array example above, you will be given the directions `["lefT", "downT", "rightT", "rightT"]`, making for the word `"pa$$"`.
Remember you initial position is the character "x".
So you write the function `getPassword(grid, directions)` that uses the directions to get a password in the grid.
Another example.
Once again, Your initial position is the character "x", so from the position of "x" you follow the directions given and get all pieces in the grid.
def get_password(grid,directions):
    #generate start point
    start = [[k,x] for k,v in enumerate(grid) for x,y in enumerate(v) if y=='x'][0]
    curr = start
    a = ''
    for i in directions:
        if i[-1] == 'T':
            if i == 'leftT':
                curr[1] -= 1
                a+= grid[curr[0]][curr[1]]
            if i == 'rightT':
                curr[1] += 1
                a+= grid[curr[0]][curr[1]]
            if i == 'upT':
                curr[0] -= 1
                a+= grid[curr[0]][curr[1]]
            if i == 'downT':
                curr[0] += 1 
                a+= grid[curr[0]][curr[1]]
        if i[-1] != 'T':
            if i == 'left':
                curr[1] -= 1
            if i == 'right':
                curr[1] += 1
            if i == 'up':
                curr[0] -= 1
            if i == 'down':
                curr[0] += 1
    return a    

    
                

def get_password(grid,directions):
    #generate start point
    start = [[k,x] for k,v in enumerate(grid) for x,y in enumerate(v) if y=='x'][0]
    curr = start
    a = ''
    for i in directions:
        if i[-1] == 'T':
            if i == 'leftT':
                curr[1] -= 1
                a+= grid[curr[0]][curr[1]]
            if i == 'rightT':
                curr[1] += 1
                a+= grid[curr[0]][curr[1]]
            if i == 'upT':
                curr[0] -= 1
                a+= grid[curr[0]][curr[1]]
            if i == 'downT':
                curr[0] += 1 
                a+= grid[curr[0]][curr[1]]
        if i[-1] != 'T':
            if i == 'left':
                curr[1] -= 1
            if i == 'right':
                curr[1] += 1
            if i == 'up':
                curr[0] -= 1
            if i == 'down':
                curr[0] += 1
    return a    

    
                
