9. Length of a String
Foundation1000 ms256 MBSolved by 0%
Read one line of text and print how many characters it contains.
Spaces count. The newline at the end of the line does not.
Constraints - The line contains between 1 and 100000 characters. - Only printable ASCII.
Input
A single line of text.
Output
Print one integer, the number of characters on the line, spaces included. The trailing newline does not count.
Inputhello
Output5
Noteis a single word
Inputhello world
Output11
Notecontains a space, which counts as a character
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.