Function to return the count of indices in from the given binary matrix having equal count of set bits in its row and column
static int countPosition ( int [ , ] mat ) { int n = mat . GetLength ( 0 ) ; int m = mat . GetLength ( 1 ) ;