Given a string S consisting of upper/lower-case alphabets and empty space characters ‘ ‘. The string may contain spaces at the end. You will have return the length of last word which consists of alphabets only.
First line of input consists of T test cases. The only line of every test case consists of String S.
You have to return the length of last word of the string.
Geeks for Geeks
Start Coding Here Output: