Longest substrings without repeating characters: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: added "when long enough" remark) |
|||
Line 47: | Line 47: | ||
If the current character occurs in start..i we trim left until cleared, otherwise/then we add any longer/equal len start..i to the result set.<br> |
If the current character occurs in start..i we trim left until cleared, otherwise/then we add any longer/equal len start..i to the result set.<br> |
||
Should be exponentially faster than collecting all possible substrings and then eliminating those with duplicate characters or too short.<br> |
Should be exponentially faster than collecting all possible substrings and then eliminating those with duplicate characters or too short.<br> |
||
It will however collect duplicates before weeding them out at the end. |
It will however collect duplicates (when long enough) before weeding them out at the end. |
||
<!--<lang Phix>(phixonline)--> |
<!--<lang Phix>(phixonline)--> |
||
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span> |
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span> |