0
A=[[1,2,3], [5,3,2]]
How to find min value in matrix? How to sort matrix with the sum of elements?
2 Answers
0
here is an awesome article
https://medium.freecodecamp.org/three-ways-to-return-largest-numbers-in-arrays-in-javascript-5d977baa80a1
0
my_matrix = [[1,2,3],[5,3,2]]
# you can convert it to a standard list then find the minimum
flattened = [i for j in my_matrix for i in j]
print(flattened, min(flattened))
# or if you want the sum of matix elements
the_sums = [sum(i) for i in my_matrix]
print(the_sums)