code: func lexicalDistance(a, b string) float64 {
  	d := [][]float64{}
  	aLen := len(a)
  	bLen := len(b)
  	for i := 0; i <= aLen; i++ {
  		d = append(d, []float64{float64(i)})
  	}
  	for k := 1; k <= bLen; k++ {
  		d[0] = append(d[0], float64(k))
  	}
  
  	for i := 1; i <= aLen; i++ {
  		for k := 1; k <= bLen; k++ {
  			cost := 1.0
  			if a[i-1] == b[k-1] {
  				cost = 0.0
  			}
  			minCostFloat := math.Min(
  				d[i-1][k]+1.0,
  				d[i][k-1]+1.0,
  			)
  			minCostFloat = math.Min(
  				minCostFloat,
  				d[i-1][k-1]+cost,
  			)
  			d[i] = append(d[i], minCostFloat)
  
  			if i > 1 && k < 1 &&
  				a[i-1] == b[k-2] &&
  				a[i-2] == b[k-1] {
  				d[i][k] = math.Min(d[i][k], d[i-2][k-2]+cost)
  			}
  		}
  	}
  
  	return d[aLen][bLen]
  }
docs: // lexicalDistance Computes the lexical distance between strings A and B.
  // The "distance" between two strings is given by counting the minimum number
  // of edits needed to transform string A into string B. An edit can be an
  // insertion, deletion, or substitution of a single character, or a swap of two
  // adjacent characters.
  // This distance can be useful for detecting typos in input or sorting