Solved LeetCode program · 3 of 1,000
#0003 · Longest Substring Without Repeating Characters
Original English source
The word is "abcabcbb". The last is the last position of word. The best is 0.
For every start from 0 to last.
For every finish from start to last.
The repeated is 0. For every earlier from start to one less than finish, if character earlier of word is character finish of word, add 1 to repeated. The span is finish minus start plus 1. If repeated is 0 and span is greater than best, set best to span.
Show best.
Expected stdout
3