写了一个代码, 是解决求最大不含重复字符子字符串的问题的 有兴趣的同仁可以看一看,指出有什么不足的地方 public int Fun(string st) { int count = st.Length; int countSum=1; int sInfo; int eInfo;
#!/usr/bin/env python
def levenshtein(a,b):
"Calculates the Levenshtein distance between a and b."
n, m = len(a), len(b)
if n > m:
# Make sure n <= m, to use O(min(n,m)) space
a,b = b,a
n,m = m,n
current = range(n+1)
for i in range(1,m+1):
previous, current = current, [i]+[0]*n
for j in range(1,n+1):
add, delete = previous[j]+1, current[j-1]+1
change = previous[j-1]
if a[j-1] != b[i-1]:
change = change + 1
current[j] = min(add, delete, change)
return current[n]
def levenshtein_distance(first, second):
"""Find the Leven