in reply to Re: Unique-Character Substring
in thread Unique-Character Substring
First of all index is a O(n) operation. If you build a hash first and use that it is still logarithmic (not sure if study does that) but you lose.
Also if there are multiple substrings of the maximum length you return only one of them. Try the string "hello hello" out. Jeff finds "lo he" and "o hel". You only find "lo he".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: Unique-Character Substring
by salvadors (Pilgrim) on Jan 20, 2001 at 21:40 UTC |