475. Length of Last Word
EasyString
Print the length of the last word in the line (words are separated by spaces; there may be extra spaces).
Input format
One line
Output format
The length.
Example 1
Input
Hello World
Output
5
Example 2
Input
fly me to the moon
Output
4
Constraints
At least one word.
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…