Sudoku solver using functional programming