Skip to content

Instantly share code, notes, and snippets.

@athiwatc
athiwatc / LevenshteinDistance.go
Created July 7, 2011 12:05
LevenshteinDistance
package LevenshteinDistance
import "fmt"
import "math"
func compare(a, b string) int {
var cost int
d := make([][]int, len(a)+1)
for i := 0; i < len(d); i++ {
d[i] = make([]int, len(b)+1)