Column with a few zeros

Write a function zcol(mat) that receives an n × m matrix of integers mat
and finds the first column with at least a 10% of zeros with respect to
the column size, returning the value of that column at the first row. If
no such column exists, it must return the sum of all the elements of the
matrix. You can count on both the number of rows and the number of
columns being strictly positive.

Observation

You can safely assume only that the rows of the matrix are either tuples
or lists, and that the matrix itself is either a tuple of rows or a list
of rows.

Problem information

Author: José Luis Balcázar

Generation: 2026-01-25T16:52:02.152Z

© Jutge.org, 2006–2026.
https://jutge.org
