#C13140. First Non-Repeating Substring
First Non-Repeating Substring
First Non-Repeating Substring
Given a string s consisting of lowercase letters and an integer k, find the first substring of length $$k$$ of s that has no repeating characters. In other words, for a substring \(t\) of length \(k\), it must satisfy the condition:
[ |{ c \in t }| = k ]
If such a substring exists, output it; otherwise, output an empty string.
Note: A substring is a contiguous block of characters in s.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains the string s (only lowercase letters).
- The second line contains an integer k, the required length of the substring.
outputFormat
Output the first substring of length k in s that contains no repeating characters. If no such substring exists, output an empty string.
## sampleabcabcbb
3
abc