#K15261. Longest Unique Substring
Longest Unique Substring
Longest Unique Substring
Given a string s, your task is to find the longest substring without repeating characters. If there are multiple substrings with the same maximum length, return the one that appears first in the string.
You will be given multiple test cases. For each test case, you are provided a single string. Solve this efficiently using methods such as the sliding window technique.
Note that the answer must be a contiguous substring of the input string.
inputFormat
The first line contains an integer T
denoting the number of test cases. Each of the following T
lines contains a non-empty string s
consisting of English letters.
outputFormat
For each test case, output the longest substring without repeating characters in a separate line.
## sample2
abcabcbb
bbbbb
abc
b
</p>