leetle

Daily challenge for 2026-01-15

380. Count Words with Prefix

Given an array of strings words and a string pref, return the number of strings in words that contain pref as a prefix.

A prefix of a string s is any leading contiguous substring of s.

Example:
Input: words = ["pay","attention","practice","attend"], pref = "at"
Output: 2

Run this challenge interactively in Python or JavaScript when the app loads.