Compute the sum of the corner elements of an array (vector or matrix).
If any corner element is NaN, return NaN.
If any corner element is Inf, return Inf.
If both NaN and Inf appear among the corners, return -1.
If the input is empty, return [].
Some built-in functions are forbidden.

Solution Stats

6 Solutions

4 Solvers

Last Solution submitted on Apr 22, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...