Stores the dimensions of the mat
var m = mat . length ; var n = mat [ 0 ] . length ; var rows = Array . from ( { length : m } , ( _ , i ) => 0 ) ; var cols = Array . from ( { length : n } , ( _ , i ) => 0 ) ; var i , j ;