Help me debug this chunk of code which has no compilation errors but is not working as expected
<p>I am coding this Sudoku Solver with the following algorithm:</p>

<p>Given a grid which is assumed to be a valid sudoku puzzle and exists at least 1 solution, it'll find the first solution and return it.</p>

<p>The puzzle is stored in a 2D array representing 9x9 slots.</p>

<p>If a solution does not exist, it returns a puzzle where puzzle[0][0] = 0, else all slots in the puzzle is supposedly filled up with values (1-9).</p>

<p>The algorithm is a bruteforce recursive method:</p>

<ol>
<li>It searches the puzzle row by row for a single slot.</li>
<li>The method <code>possibleValuesInGrid()</code> returns the possible values that can fit into the slot based on the current puzzle and its existing values.</li>
<li>If there are no possible values to be placed in the slot, it returns a False (puzzle[0][0] = 0) </li>
<li>ELSE, it pops one of the values from the <code>LinkedList</code> of possible values and insert into the slot, and recursively call the same method again till all the slots are filled up.</li>
</ol>

<p><hr /></p>

<p>The code is being hosted at pastebin so I don't flood this page. I suspect there might be a logic error somewhere although its a bruteforce method, or even a bug that I can't seem to figure.</p>

<p>I have hardcoded some system printlines to read through to figure for logic error, however I couldn't figure out where.</p>

<p>Also, how it stopped at [8][4] is also curious.</p>

<ul>
<li><a href="http://pastebin.com/fa6227fe" rel="nofollow">utils/PuzzleSolverBruteForce.java</a></li>
<li><a href="http://pastebin.com/f36b89afe" rel="nofollow">utils/PuzzleGenerator.java</a> (not completed, but the dependency part for BruteForce class is done in here, and completed)</li>
<li><a href="http://pastebin.com/f6adb45a0" rel="nofollow">runtime printlines for logic debugging</a>.</li>
</ul>
