Longest substring which occurs more than once

Act-On interview question