title: How to return the highest value from a multi dimensional array?
body: <p>Say I have a multi dimensional array like the following:</p>
  
  <pre><code>[
     [.1, .2, .9],
     [.3, .4, .5],
     [.2, .4, .8]
  ]
  </code></pre>
  
  <p>What would be the best* way to return a single dimension array that contains the highest value from each sub-array (<code>[.9,.5,.8]</code>)?  I assume I could do it manually doing something like below:</p>
  
  <pre><code>newArray = []
  for subarray in array:
     maxItem = 0
     for item in subarray:
         if item &gt; maxItem:
             maxItem = item
     newArray.append(maxItem)
  </code></pre>
  
  <p>But I'm curious if there is a cleaner way to do this?</p>
  
  <p>*In this case best = fewest lines of code</p>