Is there a one line code to find maximal value in a matrix?
<p>To find the maximal value in a matrix of numbers, we can code 5 lines to solve the problem:</p>

<pre><code>ans = matrix[0][0]
for x in range(len(matrix)):
    for y in range(len(matrix[0])):
        ans = max(ans, matrix[x][y])
return ans
</code></pre>

<p>Is there a one line solution for this problem?
The one that I came up with is pretty awkward actually:</p>

<pre><code>return max(max(matrix, key=max))
</code></pre>

<p>or</p>

<pre><code>return max(map(max, matrix))
</code></pre>