Maximum Unique String Split
Cut a string into as many pieces as possible while keeping every piece different.
The problem
Implement Solution.maxUniqueSplit(text). Cut text into consecutive non-empty pieces that together spell text, so that no two pieces are the same string. Return the largest number of pieces you can get. For example, "ababccc" can be cut into ["a", "b", "ab", "c", "cc"], which gives 5. Pieces may be longer than one letter; only whole pieces have to differ. Constraints: text has 1 to 16 lowercase English letters.
Starter code
class Solution:
def maxUniqueSplit(self, text):
passPublic examples
text = "ababccc"gives5text = "ab"gives2text = "aa"gives1
Solving it in the practice book needs an active paid plan.
Open it in the practice bookOne thought at a time.
