LearnPy Hub
← Exceptions problems
Hard

Validate a Grid

Read r, then r lines of integers. If any line has a different length from the first, or contains a non-number, print the first problem: row K: wrong length or row K: not a number. Otherwise print the grid total.

Input

r, then r lines.

Output

One line.

Sample 1

Input
2
1 2
3 4
Output
10

Sample 2

Input
2
1 2
3
Output
row 2: wrong length
solution.py
Output appears here
Validate a Grid · Python practice problem · LearnPy Hub