FastPrepFastPrep
Problem Brief

Minimum Substrings Without Repeating Characters

OA
See Microsoft online assessment and hiring insights

Given a string S, find the minimum number of substrings without repeating characters.

1Example 1

Input
S = "word"
Output
1
Explanation
The answer is 1 as "word" doesn't have any duplicates.

2Example 2

Input
S = "dddd"
Output
4
Explanation
The answer is 4 as we can only form substrings "d", "d", "d", "d".

3Example 3

Input
S = "cycle"
Output
2
Explanation
The answer is 2 as we can make substrings "cy" and "cle".
public int minimumSubstringsWithoutRepeatingCharacters(String s) {
  // write your code here
}
Input

S

"word"

Output

1

Sign in to submit your solution.