Place a number inside a square grid and ensure that all rows and columns do not contain the same number twice.