def get_n_shortest(n, coins, playerLocation, dist_matrix):
    """Return the n closest coins to the player location"""
    new_coins = coins[:]
    new_coins = sorted(new_coins, key=lambda x: dist_matrix[playerLocation][x])
    return new_coins[:n]