Zahra.H's blog

By Zahra.H, 9 years ago, In English

i wrote this code for min of distance of two strings s and t . but whatever i do it doesnt work for all tests i want

i want that the answer of these two test be 2

test 1 : s = "abbc" // t = "babb"

test2 : s = "aa" // t = "bb"

here is my code http://paste.ubuntu.com/11068656/ thank u so mcuh :)

PS : maybe it be obvious idk 'cause im a beginner :)

  • Vote: I like it
  • +4
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Can you give me link with statement,I'll try too help you? I don't know what you think when you said 'distance between strings' .

»
9 years ago, # |
  Vote: I like it +7 Vote: I do not like it

if (s[i — 1] == t[i — 1]) Pretty sure there should be s[i-1]==t[j-1]