Given a Boolean Matrix, find k such that all elements in k’th row are 0 and k’th column are 1. Do it in O(n) time

Given a binary matrix mat[n][n], find k such that all elements in k’th row are 0 and all elements in k’th column are 1. The value of mat[k][k] can be anything (either 0 or 1). If no such k exists, return -1.

This is a preview of

Find k such that kth row is all zero and kth col is all one in a matrix. Read the full post (682 words, estimated 2:44 mins reading time)