First different char in two strings?
dgallion1 at yahoo.com
Tue May 23 19:00:53 CEST 2000
>Ah, but with only a minor mod, time it again: ;-)
>a = "abc"*
>b = a[:-1]+'l'
>for i in range(len(a)-1,0,-1):
> if b[i] != a[i]:
I missed the meaning of the ";-)"
Then didn't read close enough the
But your absolutely correct
Unexpectedly the binary search still wins.
Change "range" to "xrange" and it becomes faster.
0.00999999046326 sec Reverse linear
0.0900000333786 sec Binary search
But the strings have to be the same length.
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
More information about the Python-list