


The first line contains a single integer T representing the number of test cases.
The first and the only line of each test case will contain the input string.
For each test case, print a character denoting the first non-repeating character in the input string.
You do not need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= Length of Input String <= 10^4
Time Limit: 1 sec
We will traverse the whole array and check if that element previously occurred or not.
The steps are as follows:
We will traverse the whole array and keep a count of the frequency of each element. If the frequency is one, then we return that element. If the occurrence of all the elements is more than one, then we simply return the first character of the string.
The steps are as follows: