from typing import Dict
from typing import List


def avoid_walls(my_head: Dict[str, int], board_width: int, board_height: int, possible_moves: List[str]) -> List[str]:
    """
    my_head: Dictionary of x/y coordinates of the Battlesnake head.
          e.g. {"x": 0, "y": 0}
    board_width: Width of the board (x-axis)
    board_height: Height of the board (y-axis)
    possible_moves: List of strings. Moves to pick from.
          e.g. ["up", "down", "left", "right"]

    return: The list of remaining possible_moves, with the 'neck' direction removed
    """
    if my_head["x"] == 0:
        possible_moves.remove("left")
    elif my_head["x"] == board_width - 1:
        possible_moves.remove("right")

    if my_head["y"] == 0:
        possible_moves.remove("down")
    elif my_head["y"] == board_height - 1:
        possible_moves.remove("up")

    return possible_moves