Search
⌘K
Get Premium
Leetcode 3639. Minimum Time to Activate String
Given a permutation order that replaces characters with '*' over time, find the minimum t such that the number of substrings containing at least one '*' is ≥ k. Key idea: the condition is monotonic in t, so binary-search t and check in O(n) by computing valid substrings as total substrings minus the sum of substrings inside contiguous non-'*' segments.
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.