Count

0

0 votes
Easy
Problem

Given an array of characters print the characters that have ‘n’ number of occurrences. If a character appears consecutively it is counted as 1 occurrence.

Input:

First line of input contains the number of test cases T. Then T test cases follow. The first line of each test case is the character array. The second line contains the value of n.

Output:

Print the characters that have 'n' number of occurrences. Ouput of each test case will be printed on a new line and each character will be seperated by space.. 

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?