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.
Input: 3 1 1 0 1 1 0 1 1 0 Output: 2 Explanation: 2nd column (0-based indexing) is having 3 zeros which is maximum.
Input: 3 0 1 0 0 0 1 0 1 0 Output: 0 Explanation: 0th column (0-based indexing) is having 3 zeros which is maximum. Constraints: 1 <= N <= 102 0 <= A[i][j] <= 1
Your task is to complete the function columnWithMaxZero() which should return the column number with maximum number of zeros. If more than one column exists, print the one which comes first.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.