Problem 2255 · Easy

Count Prefixes of a Given String

Test each word as a prefix of s by comparing it with the start of s, and count the matches.

Open the interactive visualisation