why we take array visited[256] and I don’t understand what is the need of i-current_len>last_occurence
line no 25
Maximum length unique character Substring sliding window
We take array visited[256] because total number of characters(in the ascii table) is 256. Ascii value ranges from 0 to 255.
i-current_len>last_occurence is required to check if the character is present in the current window or not.
It must be explained in the video. You must watch it again for more clarity.
1 Like