Adding the empty string to the lexikon allows the following shortening:
$lookup{''} = 1; substr($word, 0, 1) = "" while !exists $lookup{$word};
In reply to Re^4: Longest String Matching
by hdb
in thread Longest String Matching
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |