Longest substrings without repeating characters: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: matched an invocation to the procedure name.)
Line 398: Line 398:
x= /*X: the substring, less the 1st char*/
x= /*X: the substring, less the 1st char*/
do k=j+1 to L; x= x || substr($, k, 1) /*search for the max length substrings.*/
do k=j+1 to L; x= x || substr($, k, 1) /*search for the max length substrings.*/
if \okx(x) then iterate j /*Are there an replications? Skip it. */
if \OKx(x) then iterate j /*Are there an replications? Skip it. */
_= length(x); if _<maxL then iterate /*is length less then the current max? */
_= length(x); if _<maxL then iterate /*is length less then the current max? */
@._= @._ x; maxL= _ /*add this substring to the max list. */
@._= @._ x; maxL= _ /*add this substring to the max list. */