El lunes, 6 de junio de 2016, 18:53:46 (UTC-4), Jeffrey Sarnoff escribió:
>
> ```
> indexOfFirstNonmatching("abcd","abcd") == 0 
> indexOfFirstNonmatching("abcd","abdc") == 3
> ```
> what is a fast way to do this with strings of 50-1000 characters?
>

How about 

s1 = "abcd"
s2 = "abdc"

 for (i, (c, d)) in enumerate(zip(s1, s2))
       c != d && return i
 end 

Reply via email to