Longest substrings without repeating characters: Difference between revisions

Content added Content deleted
Line 605: Line 605:
local fn substrings( t as CFStringRef )
local fn substrings( t as CFStringRef )
int beg, c, f, rpt, max = 0
int beg, c, f, rpt, max = 0
for beg = 0 to len(t)//-1
for beg = 0 to len(t) - 1
rpt = instr( beg+1, t, mid(t, beg, 1), NSCaseInsensitiveSearch )
rpt = instr( beg+1, t, mid(t, beg, 1), NSCaseInsensitiveSearch )
if rpt < 0 then rpt = len(t)
if rpt < 0 then rpt = len(t)