fork download
  1. function r=f(s,t)
  2. s=lower(s);t=lower(t);u=unique([s t]);r=sum(abs(histc(s,u)-histc(t,u)));
  3.  
  4. end %// needed in online compiler only
  5.  
  6. input1 = 'This is not exactly like Levenshtein distance,';
  7. input2 = 'but you''ll notice it is quite similar.';
  8. f(input1, input2)
Success #stdin #stdout 0.18s 65184KB
stdin
Standard input is empty
stdout
ans =  30