Verisk interview question

Trapping rainwater problem. Longest substring without duplicates.