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 . length ; int m = mat [ 0 ] . length ;