line. A chunk is a maximal run of consecutive non-space characters.
Return the number of chunks in the line. Spaces may come in runs, and the line may start or end with spaces.line=" ok, let's go! " → 3
The space-free chunks are ok,, let's and go!. Extra spaces at the edges and in between change nothing.
line="2+2=4" → 1
There are no spaces, so the whole line is one chunk.
line=" " → 0
Only spaces, so there are no chunks.
line="" → 0
line consists of English letters, digits, spaces and the characters !@#$%^&*()_+-=',.:line=" ok, let's go! "
3
Run checks the first 3 tests in your browser. Submit checks all 6 tests on the server, hidden ones included.