Given a string, we have to find the longest word in the input string and then calculate the number of characters in this word.
The first line of input contains an integer T, number of test cases. For each test case, there is a string s.
For each test case, the output is an integer denoting the length of the longest word in the sentence.
A computer science portal for geeks
I am an intern at geeksforgeeks
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.