3458. Select K Disjoint Special Substrings
Given a string
sof lengthnand an integerk, determine whether it is possible to selectkdisjoint special substrings.A special substring is a substring where:
- Any character present inside the substring should not appear outside it in the string.
- The substring is not the entire string
s.Note that all
ksubstrings must be disjoint, meaning they cannot overlap.Return
trueif it is possible to selectksuch disjoint special substrings; otherwise, returnfalse.