FunctionRacerProblemsRace

Lower Triangle Total

BeginnerNumPyPython

m is a square 2-D array. Return the sum of the cells that are on the main diagonal or below it (the cells where the row number is at least the column number), as an int. Hint: np.tril.

Example 1

m [[1,2],[3,4]]
returns 8

1 + 3 + 4 = 8, leaving out the 2 above the diagonal.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems