OfferUp can analyze listing titles to identify the longest segment containing no repeated characters. Given a string title, return the length of its longest substring with all distinct characters.
A substring must consist of consecutive characters. Characters are case-sensitive, so A and a are different.
title containing zero or more printable characters.def longest_unique_title_segment(title):