Display longest name
Submissions: 4592   Accuracy:

49.73%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given a list of names, display the longest name.

Input:
First line of input contains an integer T, the number of test cases. For each test case, there will be two lines. First line contains integer N i.e. total number of names, and second line contains N space seperated names of different length.

Output:
Longest name in the list of names.

Constraints:
1 <= T <= 10
1 <= N <= 10

1 <= |length of name| <= 1000

Example:
Input:
1
5
Geek
Geeks
Geeksfor
GeeksforGeek
GeeksforGeeks

Output:
GeeksforGeeks

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

Contributor: Harsh Agarwal
Author: harsh.agarwal0


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.