Search
⌘K
Get Premium
Leetcode 3042. Count Prefix and Suffix Pairs I
Count the number of index pairs (i < j) such that words[i] is both a prefix and a suffix of words[j] (i.e., words[j] starts and ends with words[i]). With n ≤ 50 and word length ≤ 10, this can be solved directly by pairwise string comparisons.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.