docs: function matrixToGravityArray(mat) {
    const rows = mat.length;
    const cols = mat[0].length;
    const rowTip = rows - 1;
    const colTip = cols - 1;
    const gravityArr = [];
  
    let row, col, sum, topSum = 0;
    for (row = 0; row < rows; row++) {
      for (col = 0; col < cols; col++) {
        sum = mat[row][col];
        if (!sum) continue;
  
        topSum = Math.max(topSum, sum);
  
        gravityArr.push({ row, col, sum });
      }
    }
  
    return {
      gravityArr,
      topSum
    };
  }