Say I have a multi dimensional array like the following:

```
[
   [.1, .2, .9],
   [.3, .4, .5],
   [.2, .4, .8]
]

```

What would be the best\* way to return a single dimension array that contains the highest value from each sub-array (`[.9,.5,.8]`)? I assume I could do it manually doing something like below:

```
newArray = []
for subarray in array:
   maxItem = 0
   for item in subarray:
       if item > maxItem:
           maxItem = item
   newArray.append(maxItem)

```

But I'm curious if there is a cleaner way to do this?

\*In this case best = fewest lines of code