#C13140. First Non-Repeating Substring

    ID: 42646 Type: Default 1000ms 256MiB

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:

  1. The first line contains the string s (only lowercase letters).
  2. 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.

## sample
abcabcbb
3
abc