P17279 [GeeksforGeeks] Predict the column
普及-
题目描述

Given a matrix(2D array) M of size N*N consisting of 0s and 1s only. The task is to find the column with maximum number of 0s.
Example:
Input:
N = 3
M[][] = {{1, 1, 0},
{1, 1, 0},
{1, 1, 0}}
Output:2
Explanation:
2nd column (0-based indexing)
is having 3 zeros which is
maximum among all columns.

Your Task:
Your task is to complete the function columnWithMaxZero() which should return the column number with the maximum number of zeros. If more than one column exists, print the one which comes first.
Constraints:
1 <= N <= 10^{2}
0 <= A[i][j] <= 1

输入格式

见题面

输出格式

见题面

样例输入
N = 3 M[][] = {{1, 1, 0}, {1, 1, 0}, {1, 1, 0}}
样例输出
2