Frage im Vorstellungsgespräch bei Travelfusion

return longest substring with same continous characters only using a single loop