def check_codes(ai: list[int], user: list[int]) -> tuple[int, int]:
    """Checks amount of numbers and placement correct in the user code. Returns in format (hurt, dead)"""

    codes_status = {"hurt": [], "dead": []}

    for idx in range(4):
        if user[idx] == ai[idx]:
            codes_status["dead"].append(user[idx])

    for n in user:
        if n in ai and n not in codes_status["dead"]:
            codes_status["hurt"].append(n)

    hurt, dead = [len(codes_status[key]) for key in codes_status.keys()]

    # Hurt are wrong placed numbers and dead are correct numbers in correct positions
    return hurt, dead