Meta Interview Question

A problem similar to longest substring