โ† Amazon questions

Count number of words in a given string

Filed under Amazon

Given a string, count the number of words present. A word is defined as a sequence of non-space characters separated by one or more spaces.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.