about | help | code help+videos | done | prefs |
Given an input String, find the number of words. For this problem, a word is defined very simply as any set of characters which are not spaces. Preconditions: all words will be separated by only one space, and each input will contain one or more words. Also, no inputs will begin or end with spaces (for that bit of fun, see the next problem). HINT: think about how many spaces there are in the input.apcsaChatbotsCountWords("Hello world") → 2 apcsaChatbotsCountWords("Hello to the world") → 4 apcsaChatbotsCountWords("Wonderful") → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 210
Copyright Nick Parlante 2017 - privacy