3458. Select K Disjoint Special Substrings
Given a string
s
of lengthn
and an integerk
, determine whether it is possible to selectk
disjoint 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
k
substrings must be disjoint, meaning they cannot overlap.Return
true
if it is possible to selectk
such disjoint special substrings; otherwise, returnfalse
.
c++
1 | class Solution { |