BETA

Difficulty Level:

Easy

Total Submissions: 8663 Accuracy:

39.69%

Non Repeating Character

Given a string s consisting of lowercase Latin Letters, find the first non repeating character in s.

Input:

The first line contains T denoting the number of testcases. Then follows description of testcases.
Each case begins with a single integer N denoting the length of string. The next line contains the string s.
 
Output:


 For each testcase, print the first non repeating character present in string.
 
 Print -1 if there is no non repeating character.
 
Constraints:


 1<=T<=50
 1<=N<=100


Example:


Input :

3
5  
hello
12
zxvczbtxyzvy
6
xxyyzz

 

Output :

h
c
-1

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.