Verisk Interview Question

Trapping rainwater problem. Longest substring without duplicates.