How to solve sudoku logically