code: function(source, target) {
    const sourceLen = source.length;
    const targetLen = target.length;
    let sourceSegment,
      targetSegment;
    let temp = 0;
    if (sourceLen === 0 || targetLen === 0) {
      return null;
    }
    const dist = [];
    for (let i = 0; i <= sourceLen; i++) {
      dist[i] = [];
      dist[i][0] = { min: i };
    }
    for (let j = 0; j <= targetLen; j++) {
      dist[0][j] = { min: j };
    }
  
    for (let i = 1; i <= sourceLen; i++) {
      sourceSegment = source[i - 1];
      for (let j = 1; j <= targetLen; j++) {
        targetSegment = target[j - 1];
        if (isEqual(sourceSegment, targetSegment)) {
          temp = 0;
        } else {
          temp = 1;
        }
        const del = dist[i - 1][j].min + 1;
        const add = dist[i][j - 1].min + 1;
        const modify = dist[i - 1][j - 1].min + temp;
        dist[i][j] = getMinDiff(del, add, modify);
      }
    }
    return dist;
  }
docs: /*
  https://en.wikipedia.org/wiki/Levenshtein_distance
  计算两条path的编辑距离