Anonymous user
Longest common prefix: Difference between revisions
Changed code to look similar to the one on Longest common suffix.
(Rather than creating a new string, update its length.) |
(Changed code to look similar to the one on Longest common suffix.) |
||
Line 2,231:
for i in 1..list.high:
var newLength = 0
for j
if j >= list[i].len or list[i][j] !=
break
inc newLength
|