MixerBox interview question

Substring question Using window can solve this question