Search
⌘K

Leetcode 3485. Longest Common Prefix of K Strings After Removal

For each index i, compute the maximum length L such that some prefix of length L appears in at least k strings (counting duplicates) among the array after removing words[i] (return 0 if fewer than k strings remain). The core challenge is to aggregate prefix occurrence counts across all strings and answer these per-index exclusion queries efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.