Snap interview question

Essentially LC longest happy string question