Counting Words With a Given Prefix | Leetcode 2185