I don't remember exactly, but given an N by N grid representing a farm with cows on it, write a function that would place the cows on the grid to satisfy some requirements.
For this exercise, place exactly one cow in every row and column, with no two cows sharing a diagonal. Return one valid grid, or an empty grid when placement is impossible.
Use def solve_cows(n):. Return an n x n matrix of 0 and 1, where 1 represents a cow.
def solve_cows(n):