Sum a Multi-Dimensional Array

Given a MultiDimArray object m representing an array with an arbitrary number of dimensions, implement:

def arraySum(m: MultiDimArray) -> int:

The object provides:

  • `m.getDims() ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: