Skip to content
← Back to the archive

31 August 2026

Name Parts

Easy Strings Lists

Count the words in each club member name.

You are given a list of club member names. Each name contains one or more words. For each name, count how many words it contains. Return the list of word counts in the same order. Return an empty list when there are no names.

Constraints

  • names contains at most 50 names
  • Each name contains lowercase words separated by single spaces
  • Each name has at least one word

Function signature

def name_word_counts(names):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.