Skip to content

Commit 9566737

Browse files
committed
Create README - LeetHub
1 parent 28dde2b commit 9566737

File tree

1 file changed

+42
-0
lines changed
  • 1593-split-a-string-into-the-max-number-of-unique-substrings

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<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&nbsp;<code>s</code><var>,</var>&nbsp;return <em>the maximum&nbsp;number of unique substrings that the given string can be split into</em>.</p>
2+
3+
<p>You can split string&nbsp;<code>s</code> into any list of&nbsp;<strong>non-empty substrings</strong>, where the concatenation of the substrings forms the original string.&nbsp;However, you must split the substrings such that all of them are <strong>unique</strong>.</p>
4+
5+
<p>A <strong>substring</strong> is a contiguous sequence of characters within a string.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> s = &quot;ababccc&quot;
12+
<strong>Output:</strong> 5
13+
<strong>Explanation</strong>: One way to split maximally is [&#39;a&#39;, &#39;b&#39;, &#39;ab&#39;, &#39;c&#39;, &#39;cc&#39;]. Splitting like [&#39;a&#39;, &#39;b&#39;, &#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;cc&#39;] is not valid as you have &#39;a&#39; and &#39;b&#39; multiple times.
14+
</pre>
15+
16+
<p><strong class="example">Example 2:</strong></p>
17+
18+
<pre>
19+
<strong>Input:</strong> s = &quot;aba&quot;
20+
<strong>Output:</strong> 2
21+
<strong>Explanation</strong>: One way to split maximally is [&#39;a&#39;, &#39;ba&#39;].
22+
</pre>
23+
24+
<p><strong class="example">Example 3:</strong></p>
25+
26+
<pre>
27+
<strong>Input:</strong> s = &quot;aa&quot;
28+
<strong>Output:</strong> 1
29+
<strong>Explanation</strong>: It is impossible to split the string any further.
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li>
37+
<p><code>1 &lt;= s.length&nbsp;&lt;= 16</code></p>
38+
</li>
39+
<li>
40+
<p><code>s</code> contains&nbsp;only lower case English letters.</p>
41+
</li>
42+
</ul>

0 commit comments

Comments
 (0)