-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32dfe9b
commit c96bdff
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
1593-split-a-string-into-the-max-number-of-unique-substrings/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<h2><a href="https://leetcode.com/problems/split-a-string-into-the-max-number-of-unique-substrings">1593. Split a String Into the Max Number of Unique Substrings</a></h2><h3>Medium</h3><hr><p>Given a string <code>s</code><var>,</var> 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> </p> | ||
<p><strong class="example">Example 1:</strong></p> | ||
|
||
<pre> | ||
<strong>Input:</strong> s = "ababccc" | ||
<strong>Output:</strong> 5 | ||
<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. | ||
</pre> | ||
|
||
<p><strong class="example">Example 2:</strong></p> | ||
|
||
<pre> | ||
<strong>Input:</strong> s = "aba" | ||
<strong>Output:</strong> 2 | ||
<strong>Explanation</strong>: One way to split maximally is ['a', 'ba']. | ||
</pre> | ||
|
||
<p><strong class="example">Example 3:</strong></p> | ||
|
||
<pre> | ||
<strong>Input:</strong> s = "aa" | ||
<strong>Output:</strong> 1 | ||
<strong>Explanation</strong>: It is impossible to split the string any further. | ||
</pre> | ||
|
||
<p> </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> |