title: Getting the boxes from a Sudoku in Erlang
body: <p>I am new to Erlang and trying to make a Sudoku solver. So far I can have an input consisting of a list of 81 integers (9x9) like this</p>
  
  <pre><code>sudoku() -&gt; [6,7,1,8,2,3,4,9,5,5,4,9,1,7,6,3,2,8,3,2,8,5,4,9,1,6,7,1,3,2,6,5,7,8,4,9,9,8,6,4,1,2,5,7,3,4,5,7,3,9,8,6,1,2,8,9,3,2,6,4,7,5,1,7,1,4,9,3,5,2,8,6,2,6,5,7,8,1,9,3,4].
  </code></pre>
  
  <p>That I split into rows based on the <a href="https://stackoverflow.com/questions/12534898/splitting-a-list-in-equal-sized-chunks-in-erlang">list splitting algorithm by stemm</a>:</p>
  
  <pre><code>split_rows(sudoku()). 
  </code></pre>
  
  <p>Which returns:</p>
  
  <pre><code>  [5,4,9,1,7,6,3,2,8],
    [3,2,8,5,4,9,1,6,7],
    [1,3,2,6,5,7,8,4,9],
    [9,8,6,4,1,2,5,7,3],
    [4,5,7,3,9,8,6,1,2],
    [8,9,3,2,6,4,7,5,1],
    [7,1,4,9,3,5,2,8,6],
    [2,6,5,7,8,1,9,3,4]] 
  </code></pre>
  
  <p>To obtain the columns I just transpose this matrix with the <a href="https://stackoverflow.com/questions/5389254/transposing-a-2-dimensional-matrix-in-erlang">elegant solution of mpm</a>. </p>
  
  <p>The next step is to collect lists of the nine square boxes. Then I can check if there are duplicate elements in those lists to see if a solution is valid. </p>
  
  <p>Unfortunately I have no clear idea how to obtains the squares, e.g., </p>
  
  <pre><code>[[1],[2],[3],
  [4],[5],[6],
  [7],[8],[9]]
  </code></pre>
  
  <p>where each square represents the nine numbers in the block. So square one in this case looks like this:</p>
  
  <pre><code>[5,4,9,
  3,2,8,
  1,2,2]
  </code></pre>
  
  <p>Does anyone have an idea how to do this? </p>