


N = 5
S = ‘GEEK’
ANSWER:- The answer should be [(‘E’,2)] because ‘E’ is the only character that is duplicated and has frequency 2.
The first line contains a single integer ‘T’ representing the number of test cases. Then each test case follows.
The first line of every test case contains an integer ‘N’ denoting the length of the string.
The next line of every test case contains a string ‘S’ denoting the string given.
For each test case, return the duplicate characters in the string S and their frequency.
The output of each test case should be printed in a separate line.
You are not required to print anything, it has already been taken care of. Just implement the function.
1 <= T <= 5
1 <= N <= 10^5
Time Limit = 1 sec
Iterate through the string and store the frequency of every character in an array. Then iterate through the array and check if the frequency is greater than 1, if yes add the character and its frequency in the answer.