Welcome!

×

...or use your e-mail

Go back to Challenges list

Challenge

Leave No Word Uncounted

Created by
In this challenge you need to analyse a string and return the number of words present in that string. Seems pretty easy right? It is, but there are some rules:

- A word is defined by one or more alphanumeric characters (a-zA-Z0-9)
- Every other character acts like a word divisor (like a space)
- Single letters and numbers will count as words too!!!

Input Format
Each test case contains a string to be analysed.

Output Format
The output should be an integer with the number of words

Sample Input
Praesent sapien.massa, convallis a pellentesque-nec, egestas non nisi.

Sample Output
10

Memory Limit
512M


Sign Up or Login to solve this Code Challenge