Skip to content

Commit 65b3345

Browse files
committed
Create README - LeetHub
1 parent 1bd1fbd commit 65b3345

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<h2><a href="https://leetcode.com/problems/longest-happy-string">1304. Longest Happy String</a></h2><h3>Medium</h3><hr><p>A string <code>s</code> is called <strong>happy</strong> if it satisfies the following conditions:</p>
2+
3+
<ul>
4+
<li><code>s</code> only contains the letters <code>&#39;a&#39;</code>, <code>&#39;b&#39;</code>, and <code>&#39;c&#39;</code>.</li>
5+
<li><code>s</code> does not contain any of <code>&quot;aaa&quot;</code>, <code>&quot;bbb&quot;</code>, or <code>&quot;ccc&quot;</code> as a substring.</li>
6+
<li><code>s</code> contains <strong>at most</strong> <code>a</code> occurrences of the letter <code>&#39;a&#39;</code>.</li>
7+
<li><code>s</code> contains <strong>at most</strong> <code>b</code> occurrences of the letter <code>&#39;b&#39;</code>.</li>
8+
<li><code>s</code> contains <strong>at most</strong> <code>c</code> occurrences of the letter <code>&#39;c&#39;</code>.</li>
9+
</ul>
10+
11+
<p>Given three integers <code>a</code>, <code>b</code>, and <code>c</code>, return <em>the <strong>longest possible happy </strong>string</em>. If there are multiple longest happy strings, return <em>any of them</em>. If there is no such string, return <em>the empty string </em><code>&quot;&quot;</code>.</p>
12+
13+
<p>A <strong>substring</strong> is a contiguous sequence of characters within a string.</p>
14+
15+
<p>&nbsp;</p>
16+
<p><strong class="example">Example 1:</strong></p>
17+
18+
<pre>
19+
<strong>Input:</strong> a = 1, b = 1, c = 7
20+
<strong>Output:</strong> &quot;ccaccbcc&quot;
21+
<strong>Explanation:</strong> &quot;ccbccacc&quot; would also be a correct answer.
22+
</pre>
23+
24+
<p><strong class="example">Example 2:</strong></p>
25+
26+
<pre>
27+
<strong>Input:</strong> a = 7, b = 1, c = 0
28+
<strong>Output:</strong> &quot;aabaa&quot;
29+
<strong>Explanation:</strong> It is the only correct answer in this case.
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>0 &lt;= a, b, c &lt;= 100</code></li>
37+
<li><code>a + b + c &gt; 0</code></li>
38+
</ul>

0 commit comments

Comments
 (0)