words, and a user has typed the first few letters start into a search box. The hint should show how many dictionary words begin with exactly those letters.
Return the number of words in words whose first len(start) characters equal start. A word equal to start counts too. Repeated words are counted as many times as they appear.words=['sunrise', 'sunday', 'unsung', 'sun'], start='sun' → 3
"sunrise", "sunday" and "sun" itself begin with "sun". "unsung" contains those letters, but not at the start.
words=['map', 'maple'], start='maples' → 0
The stem is longer than every word, so none of them qualify.
words[i] and start consist of lowercase English letterswords=['sunrise', 'sunday', 'unsung', 'sun'], start='sun'
3
Run checks the first 3 tests in your browser. Submit checks all 155 tests on the server, hidden ones included.