solves puzzles w/o backtracking