← Back to challenges

Sum of Minimums

PythonMediumarrayslogicloopsnumbers

Instructions

Create a function that takes a 2D list lst and returns the sum of the minimum value in each row.

Examples

sum_minimums([
  [1, 2, 3, 4, 5],
  [5, 6, 7, 8, 9],
  [20, 21, 34, 56, 100]
] ➞ 26

# minimum value of the first row is 1
# minimum value of the second row is 5
# minimum value of the third row is 20

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: The Modulus Operator Function