CF1536B.Prinzessin der Verurteilung

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

I, Fischl, Prinzessin der Verurteilung, descend upon this land by the call of fate an — Oh, you are also a traveler from another world? Very well, I grant you permission to travel with me.

It is no surprise Fischl speaks with a strange choice of words. However, this time, not even Oz, her raven friend, can interpret her expressions! Maybe you can help us understand what this young princess is saying?

You are given a string of nn lowercase Latin letters, the word that Fischl just spoke. You think that the MEX of this string may help you find the meaning behind this message. The MEX of the string is defined as the shortest string that doesn't appear as a contiguous substring in the input. If multiple strings exist, the lexicographically smallest one is considered the MEX. Note that the empty substring does NOT count as a valid MEX.

A string aa is lexicographically smaller than a string bb if and only if one of the following holds:

  • aa is a prefix of bb , but aba \ne b ;
  • in the first position where aa and bb differ, the string aa has a letter that appears earlier in the alphabet than the corresponding letter in bb .

A string aa is a substring of a string bb if aa can be obtained from bb by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.

Find out what the MEX of the string is!

输入格式

Each test contains multiple test cases. The first line contains the number of test cases tt ( 1t10001 \leq t \leq 1000 ). Description of the test cases follows.

The first line of each test case contains an integer nn ( 1n10001 \leq n \leq 1000 ) — the length of the word. The second line for each test case contains a single string of nn lowercase Latin letters.

The sum of nn over all test cases will not exceed 10001000 .

输出格式

For each test case, output the MEX of the string on a new line.

输入输出样例

  • 输入#1

    3
    28
    qaabzwsxedcrfvtgbyhnujmiklop
    13
    cleanairactbd
    10
    aannttoonn

    输出#1

    ac
    f
    b
首页