from typing import Sequence
from typing import Tuple


def get_violations_count(individual: Sequence, queens_amount: int) -> Tuple[int]:
    """Get the amount of violations.
    A violation is counted if two queens are placed in the same column or are in the same diagonal.

    Args:
        individual (deap.creator.SimpleIndividual): An individual
        queens_amount (int): The amount of queens

    Returns:
        int: the amount of violations
    """
    violations_amount = 0
    for i in range(queens_amount):
        for j in range(i+1, queens_amount):
            if individual[i] == individual[j] or abs(i-j) == abs(individual[i]-individual[j]):
                violations_amount += 1

    return violations_amount,