#3090

Maximum Length Substring With Two Occurrences

easy · 65.2% accepted · 255 likes · top 69%

hash table · string · sliding window

Description

Given a string s, return the maximum length of a substring such that it contains at most two occurrences of each character.

Solution