Jump to content

Longest substrings without repeating characters: Difference between revisions

m
→‎{{header|Phix}}: added "when long enough" remark
m (→‎{{header|Phix}}: added "when long enough" remark)
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>
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 (when long enough) before weeding them out at the end.
<!--<lang Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
7,813

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.