in reply to finding number of contiguous letters
I notice that the results so far seem to rely upon an array for the result. I think that can lead to duplication- the array may have the same three letters at various indices, which will give an erroneously high result. Consider the test case "Mississippi", which has "Mis", "iss", "ssi", "sis", "sip", and "ppi"- 6 strings of three letters, eh? I think a hash is better to store the results, then count the number of keys.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: finding number of contiguous letters
by blazar (Canon) on May 23, 2007 at 20:33 UTC |