min dist of strings from a ref string