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