Count the words
easyStrings10 XP
Return how many words are in s. Words are separated by one or more spaces; spaces at the start or end don't count.
Examples
- Input: s = "I love coding"Output: 3
- Input: s = " many spaces "Output: 2
Examples use JSON: true/false/null are True/False/None in Python.