Block interview question

Write a solution to the magic square problem