Problem Link:
My Solution Link:
https://www.codechef.com/viewsolution/32858186
Your output is not correct.
For this sample input
1
4
hasan jaddouh
farhod khakimiyon
kerim kochekov
hasan khateeb
Your code is outputting following:
hasan
farhod khakimiyon
kerim kochekov
hasan
Moreover you don’t need to check if the number of testcases or any other input value is in constraint or not.
if n >= 2 and n <= 100:
if t >=1 and t <= 100: not required
Thank you Anshul for your response.
I was able to get it right after some changes.
https://www.codechef.com/viewsolution/32875501