Problem · String
Minimum Substrings Without Repeating Characters
Learn this problemProblem statement
Given a string S, find the minimum number of substrings without repeating characters.
Function
minimumSubstringsWithoutRepeatingCharacters(S: String) → intExamples
Example 1
S = "word"return = 1The answer is 1 as "word" doesn't have any duplicates.
Example 2
S = "dddd"return = 4The answer is 4 as we can only form substrings "d", "d", "d", "d".
Example 3
S = "cycle"return = 2The answer is 2 as we can make substrings "cy" and "cle".