title: nested list comprehension in elixir
body: <p>In order to learn Elixir I would like to resolve this problem: <a href="https://projecteuler.net/problem=96" rel="nofollow">https://projecteuler.net/problem=96</a></p>
  
  <p>In order to go through the board I would start like that:
  In python:</p>
  
  <pre><code>row_indexes = ["A","B","C","D","E","F","G","H","I"];
  col_indexes = ["1","2","3","4","5","6","7","8","9"];
  row_box_indexes = [["A","B","C"],["D","E","F"],["G","H","I"]];
  col_box_indexes = [["1","2","3"],["4","5","6"],["7","8","9"]];
  
  cols = [[r+c for r in row_indexes] for c in col_indexes]
  rows = [[r+c for c in col_indexes] for r in row_indexes]
  boxes = [[r+c for c in C for r in R] for C in col_box_indexes for R in row_box_indexes]
  
  print(cols) // [['A1', 'B1', 'C1', 'D1', 'E1', 'F1', 'G1', 'H1', 'I1'],...,['A9', 'B9', 'C9', 'D9', 'E9', 'F9', 'G9', 'H9', 'I9']]
  </code></pre>
  
  <p>I'm struggling using list comprehension in elixir I tried this but it puts me one list with all my result</p>
  
  <pre><code>row_indexes = ["A","B","C","D","E","F","G","H","I"];
  col_indexes = ["1","2","3","4","5","6","7","8","9"];
  row_box_indexes = [["A","B","C"],["D","E","F"],["G","H","I"]];
  col_box_indexes = [["1","2","3"],["4","5","6"],["7","8","9"]];
  
  # in iex
  for c &lt;- col_indexes,
      x &lt;- (for r &lt;- row_indexes, do: r&lt;&gt;c),
      do: x
  
  # ["A1", "B1", "C1", "D1", "E1", "F1", "G1", "H1", "I1", "A2", "B2", "C2", "D2",..., "I5", "A6", "B6", "C6", "D6", "E6", ...]
  </code></pre>
  
  <p>1) is it a good the good way to resolve this problem in Elixir ?</p>
  
  <p>2) could you explain me how I can reach the same result as print(cols) in python ?</p>
  
  <p>Thank you :)</p>