Amazon Interview Question

Remove the longest substring in a string.