Class Solution
java.lang.Object
g1501_1600.s1593_split_a_string_into_the_max_number_of_unique_substrings.Solution
1593 - Split a String Into the Max Number of Unique Substrings.<p>Medium</p>
<p>Given a string <code>s</code>, return <em>the maximum number of unique substrings that the given string can be split into</em>.</p>
<p>You can split string <code>s</code> into any list of <strong>non-empty substrings</strong> , where the concatenation of the substrings forms the original string. However, you must split the substrings such that all of them are <strong>unique</strong>.</p>
<p>A <strong>substring</strong> is a contiguous sequence of characters within a string.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “ababccc”</p>
<p><strong>Output:</strong> 5</p>
<p><strong>Explanation:</strong> One way to split maximally is [‘a’, ‘b’, ‘ab’, ‘c’, ‘cc’]. Splitting like [‘a’, ‘b’, ‘a’, ‘b’, ‘c’, ‘cc’] is not valid as you have ‘a’ and ‘b’ multiple times.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “aba”</p>
<p><strong>Output:</strong> 2</p>
<p><strong>Explanation:</strong> One way to split maximally is [‘a’, ‘ba’].</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “aa”</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> It is impossible to split the string any further.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li>
<p><code>1 <= s.length <= 16</code></p>
</li>
<li>
<p><code>s</code> contains only lower case English letters.</p>
</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
maxUniqueSplit
-