Sudoku solver based on counting constraints on boolean variables