Thanks for sharing the solutions. I think you analysis and explanation at the beginning part is great. How did you come up with these ideas? You summarized it by yourself or you found it somewhere else?
Longest Substring with At Most Two Distinct Characters
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.