Solution for Amazon sudoku task.