title: Swift flatMap: How to remove only tuples from an array where specific element in the tuple is nil?
body: <p>I have an array of tuples where the tuple contains some optional values:</p>
  
  <p><code>let arrayOfTuples: [(Int, String?, String?)] = ...</code></p>
  
  <p>How can I best remove from the array those tuples where the <strong>second element</strong> of the tuple is nil (no matter if the 3rd element is nil)?</p>
  
  <p>When I use <code>flatMap</code> like</p>
  
  <p><code>let flatTuplesArray: [(Int, String, String)] = arrayOfTuples.flatMap({ ($0, $1, $2) })</code> then a tuple does not appear in the resulting <code>flatTuplesArray</code> if the <strong>second or third element</strong> of the tuple is nil. </p>
  
  <p>I want to <em>apply</em> <code>flatMap</code> only on the first two elements of the tuple ($0 and $1) but the result array should still have tuples with three elements (and contain <code>""</code> for $2 nil values).</p>