#C13247. Longest Unique Substring
Longest Unique Substring
Longest Unique Substring
Given a string s, your task is to find the longest substring that contains no repeating characters. More formally, for a given string of length , find a substring where all characters are distinct and the length is maximized. In case there are multiple substrings with the maximum length, return the one that appears first in .
inputFormat
The input is given via stdin as a single line containing the string s
. The string may include any printable ASCII characters. It is possible that the string is empty.
outputFormat
Output via stdout the longest substring of s
that does not contain any repeating characters. If multiple answers exist, output the first one encountered.