Valid Sudoku, time limit exceeded