Grab | Online face to face | Maximum number of unique substrings
Anonymous User
546

Given a string containing only lowercase English letters, find the maximum number of substring it can be split to, where each substring is unique to another.

Example:
Input: “aa”
Output: 1, [“aa”]
Input: “abbbacb”
Output: 5, one possible combination: [“a”, “bb”, “ba”, “c”, “b”]
Input: “abcd”
Output: 4, [“a”, “b”, “c”, “d”]

Comments (2)