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, c in 0..result.high:
if j >= list[i].len or list[i][j] != cresult[j]:
break
inc newLength
Anonymous user