The number of words

The number of words. Given a string consisting of words separated by spaces, determine how many words it contains. Use the count method to solve this problem.

Test Case Input (String) Expected Output
1 Hello world 2
2 The quick brown fox jumps over the lazy dog 9
3 OpenAI is great 3