Accenture interview question

Longest substring problem, and array related problem