start to 0 and end to -1, representing the start and end of the window respectively.end pointer forward until the window becomes invalid.maxFrequency when a new character is added to the window.start pointer forward and update the frequency map accordingly.longestSubstringLength.end pointer reaches the end of the string.longestSubstringLength as the result.