title: What does the reduce(_:_:) function do in Swift?
body: <p>Here is a piece of code I don't understand. This code uses swift's reduce(<em>:</em>:) function along with the closure which I am having trouble to understand. What are the values set in <code>maxVerticalPipCount</code> and <code>maxHorizontalPipCount</code>? Are they <code>5</code> and <code>2</code> respectively?</p>
  
  <pre><code>let pipsPerRowForRank = [[0], [1], [1,1], [1,1,1], [2,2], [2,1,2], 
                              [2,2,2], [2,1,2,2], [2,2,2,2], [2,2,1,2,2], 
                              [2,2,2,2,2]]
  let maxVerticalPipCount = CGFloat(pipsPerRowForRank.reduce(0) { max($1.count, $0) })
  let maxHorizontalPipCount = CGFloat(pipsPerRowForRank.reduce(0) { max($1.max() ?? 0, $0) })
  </code></pre>