Latin squares count
Your task
Count the number of n x n Latin squares: grids filled with values 1..n such that every row and every column contains each value exactly once. Return the count. 1 <= n <= 4 (the count grows extremely fast).
Examples
count_latin_squares(n: int) -> intExample 1
Input
count_latin_squares(3)Output
12