Skip to content

[pull] main from doocs:main #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion solution/0100-0199/0131.Palindrome Partitioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tags:

<!-- description:start -->

<p>给你一个字符串 <code>s</code>,请你将<em> </em><code>s</code><em> </em>分割成一些子串,使每个子串都是 <strong><span data-keyword="palindrome-string">回文串</span></strong> 。返回 <code>s</code> 所有可能的分割方案。</p>
<p>给你一个字符串 <code>s</code>,请你将<em> </em><code>s</code><em> </em>分割成一些 <span data-keyword="substring-nonempty">子串</span>,使每个子串都是 <strong><span data-keyword="palindrome-string">回文串</span></strong> 。返回 <code>s</code> 所有可能的分割方案。</p>

<p>&nbsp;</p>

Expand Down
29 changes: 18 additions & 11 deletions solution/0500-0599/0525.Contiguous Array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,35 @@ tags:

<p>给定一个二进制数组 <code>nums</code> , 找到含有相同数量的 <code>0</code> 和 <code>1</code> 的最长连续子数组,并返回该子数组的长度。</p>

<p> </p>
<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>
<p><strong>示例 1</strong></p>

<pre>
<strong>输入:</strong> nums = [0,1]
<strong>输出:</strong> 2
<strong>说明:</strong> [0, 1] 是具有相同数量 0 和 1 的最长连续子数组。</pre>
<strong>输入</strong>nums = [0,1]
<strong>输出</strong>2
<strong>说明</strong>[0, 1] 是具有相同数量 0 和 1 的最长连续子数组。</pre>

<p><strong>示例 2:</strong></p>
<p><strong>示例 2</strong></p>

<pre>
<strong>输入:</strong> nums = [0,1,0]
<strong>输出:</strong> 2
<strong>说明:</strong> [0, 1] (或 [1, 0]) 是具有相同数量0和1的最长连续子数组。</pre>
<strong>输入</strong>nums = [0,1,0]
<strong>输出</strong>2
<strong>说明</strong>[0, 1] (或 [1, 0]) 是具有相同数量 0 和 1 的最长连续子数组。</pre>

<p> </p>
<p><strong>示例 3:</strong></p>

<pre>
<b>输入:</b>nums = [0,1,1,1,1,1,0,0,0]
<b>输出:</b>6
<b>解释:</b>[1,1,1,0,0,0] 是具有相同数量 0 和 1 的最长连续子数组。</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
<li><code>nums[i]</code> 不是 <code>0</code> 就是 <code>1</code></li>
</ul>

Expand Down
8 changes: 8 additions & 0 deletions solution/0500-0599/0525.Contiguous Array/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ tags:
<strong>Explanation:</strong> [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> nums = [0,1,1,1,1,1,0,0,0]
<strong>Output:</strong> 6
<strong>Explanation:</strong> [1,1,1,0,0,0] is the longest contiguous subarray with equal number of 0 and 1.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ tags:
(1,2,3,4) 4 个帽子的排列方案数为 24 。
</pre>

<p><strong>示例 4:</strong></p>

<pre>
<strong>输入:</strong>hats = [[1,2,3],[2,3,5,6],[1,3,7,9],[1,8,9],[2,5,7]]
<strong>输出:</strong>111
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tags:

<p>Given a 2D integer array <code>hats</code>, where <code>hats[i]</code> is a list of all hats preferred by the <code>i<sup>th</sup></code> person.</p>

<p>Return <em>the number of ways that the <code>n</code> people wear different hats to each other</em>.</p>
<p>Return the number of ways that <code>n</code> people can wear <strong>different</strong> hats from each other.</p>

<p>Since the answer may be too large, return it modulo <code>10<sup>9</sup> + 7</code>.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,44 @@ tags:

<ul>
<li>例如 <code>arr =&nbsp;[6, -3, 7, 2, 11]</code>,<code>n = 5</code>:数组排序后得到 <code>arr = [-3, 2, 6, 7, 11]</code> ,数组的中间位置为 <code>m = ((5 - 1) / 2) = 2</code> ,中位数 <code>arr[m]</code> 的值为 <code>6</code> 。</li>
<li>例如 <code>arr =&nbsp;[-7, 22, 17,&thinsp;3]</code>,<code>n = 4</code>:数组排序后得到&nbsp;<code>arr = [-7, 3, 17, 22]</code> ,数组的中间位置为&nbsp;<code>m = ((4 - 1) / 2) = 1</code> ,中位数 <code>arr[m]</code> 的值为 <code>3</code> 。</li>
<li>例如 <code>arr =&nbsp;[-7, 22, 17,3]</code>,<code>n = 4</code>:数组排序后得到&nbsp;<code>arr = [-7, 3, 17, 22]</code> ,数组的中间位置为&nbsp;<code>m = ((4 - 1) / 2) = 1</code> ,中位数 <code>arr[m]</code> 的值为 <code>3</code> 。</li>
</ul>

<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>

<pre><strong>输入:</strong>arr = [1,2,3,4,5], k = 2
<pre>
<strong>输入:</strong>arr = [1,2,3,4,5], k = 2
<strong>输出:</strong>[5,1]
<strong>解释:</strong>中位数为 3,按从强到弱顺序排序后,数组变为 [5,1,4,2,3]。最强的两个元素是 [5, 1]。[1, 5] 也是正确答案。
注意,尽管 |5 - 3| == |1 - 3| ,但是 5 比 1 更强,因为 5 &gt; 1 。
</pre>

<p><strong>示例 2:</strong></p>

<pre><strong>输入:</strong>arr = [1,1,3,5,5], k = 2
<pre>
<strong>输入:</strong>arr = [1,1,3,5,5], k = 2
<strong>输出:</strong>[5,5]
<strong>解释:</strong>中位数为 3, 按从强到弱顺序排序后,数组变为 [5,5,1,1,3]。最强的两个元素是 [5, 5]。
</pre>

<p><strong>示例 3:</strong></p>

<pre><strong>输入:</strong>arr = [6,7,11,7,6,8], k = 5
<pre>
<strong>输入:</strong>arr = [6,7,11,7,6,8], k = 5
<strong>输出:</strong>[11,8,6,6,7]
<strong>解释:</strong>中位数为 7, 按从强到弱顺序排序后,数组变为 [11,8,6,6,7,7]。
[11,8,6,6,7] 的任何排列都是正确答案。</pre>

<p><strong>示例 4:</strong></p>

<pre><strong>输入:</strong>arr = [6,-3,7,2,11], k = 3
<strong>输出:</strong>[-3,11,2]
</pre>

<p><strong>示例 5:</strong></p>

<pre><strong>输入:</strong>arr = [-7,22,17,3], k = 2
<strong>输出:</strong>[22,17]
[11,8,6,6,7] 的任何排列都是正确答案。
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>1 &lt;= arr.length &lt;= 10^5</code></li>
<li><code>-10^5 &lt;= arr[i] &lt;= 10^5</code></li>
<li><code>1 &lt;= arr.length &lt;= 10<sup>5</sup></code></li>
<li><code>-10<sup>5</sup> &lt;= arr[i] &lt;= 10<sup>5</sup></code></li>
<li><code>1 &lt;= k &lt;= arr.length</code></li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,43 @@ tags:

<p>Given an array of integers <code>arr</code> and an integer <code>k</code>.</p>

<p>A value <code>arr[i]</code> is said to be stronger than a value <code>arr[j]</code> if <code>|arr[i] - m| &gt; |arr[j] - m|</code> where <code>m</code> is the <strong>median</strong> of the array.<br />
<p>A value <code>arr[i]</code> is said to be stronger than a value <code>arr[j]</code> if <code>|arr[i] - m| &gt; |arr[j] - m|</code> where <code>m</code> is the <strong>centre</strong> of the array.<br />
If <code>|arr[i] - m| == |arr[j] - m|</code>, then <code>arr[i]</code> is said to be stronger than <code>arr[j]</code> if <code>arr[i] &gt; arr[j]</code>.</p>

<p>Return <em>a list of the strongest <code>k</code></em> values in the array. return the answer <strong>in any arbitrary order</strong>.</p>

<p><strong>Median</strong> is the middle value in an ordered integer list. More formally, if the length of the list is n, the median is the element in position <code>((n - 1) / 2)</code> in the sorted list <strong>(0-indexed)</strong>.</p>
<p>The <strong>centre</strong> is the middle value in an ordered integer list. More formally, if the length of the list is n, the centre is the element in position <code>((n - 1) / 2)</code> in the sorted list <strong>(0-indexed)</strong>.</p>

<ul>
<li>For <code>arr = [6, -3, 7, 2, 11]</code>, <code>n = 5</code> and the median is obtained by sorting the array <code>arr = [-3, 2, 6, 7, 11]</code> and the median is <code>arr[m]</code> where <code>m = ((5 - 1) / 2) = 2</code>. The median is <code>6</code>.</li>
<li>For <code>arr = [-7, 22, 17,&thinsp;3]</code>, <code>n = 4</code> and the median is obtained by sorting the array <code>arr = [-7, 3, 17, 22]</code> and the median is <code>arr[m]</code> where <code>m = ((4 - 1) / 2) = 1</code>. The median is <code>3</code>.</li>
<li>For <code>arr = [6, -3, 7, 2, 11]</code>, <code>n = 5</code> and the centre is obtained by sorting the array <code>arr = [-3, 2, 6, 7, 11]</code> and the centre is <code>arr[m]</code> where <code>m = ((5 - 1) / 2) = 2</code>. The centre is <code>6</code>.</li>
<li>For <code>arr = [-7, 22, 17,&thinsp;3]</code>, <code>n = 4</code> and the centre is obtained by sorting the array <code>arr = [-7, 3, 17, 22]</code> and the centre is <code>arr[m]</code> where <code>m = ((4 - 1) / 2) = 1</code>. The centre is <code>3</code>.</li>
</ul>

<div class="simple-translate-system-theme" id="simple-translate">
<div>
<div class="simple-translate-button isShow" style="background-image: url(&quot;moz-extension://8a9ffb6b-7e69-4e93-aae1-436a1448eff6/icons/512.png&quot;); height: 22px; width: 22px; top: 266px; left: 381px;">&nbsp;</div>

<div class="simple-translate-panel " style="width: 300px; height: 200px; top: 0px; left: 0px; font-size: 13px;">
<div class="simple-translate-result-wrapper" style="overflow: hidden;">
<div class="simple-translate-move" draggable="true">&nbsp;</div>

<div class="simple-translate-result-contents">
<p class="simple-translate-result" dir="auto">&nbsp;</p>

<p class="simple-translate-candidate" dir="auto">&nbsp;</p>
</div>
</div>
</div>
</div>
</div>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> arr = [1,2,3,4,5], k = 2
<strong>Output:</strong> [5,1]
<strong>Explanation:</strong> Median is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also <strong>accepted</strong> answer.
<strong>Explanation:</strong> Centre is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also <strong>accepted</strong> answer.
Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 &gt; 1.
</pre>

Expand All @@ -49,15 +67,15 @@ Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5
<pre>
<strong>Input:</strong> arr = [1,1,3,5,5], k = 2
<strong>Output:</strong> [5,5]
<strong>Explanation:</strong> Median is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
<strong>Explanation:</strong> Centre is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> arr = [6,7,11,7,6,8], k = 5
<strong>Output:</strong> [11,8,6,6,7]
<strong>Explanation:</strong> Median is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
<strong>Explanation:</strong> Centre is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
Any permutation of [11,8,6,6,7] is <strong>accepted</strong>.
</pre>

Expand Down
2 changes: 1 addition & 1 deletion solution/1600-1699/1683.Invalid Tweets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
| content | varchar |
+----------------+---------+
在 SQL 中,tweet_id 是这个表的主键。
content 只包含美式键盘上的字符,不包含其它特殊字符。
content 只包含字母数字字符,'!',' ',不包含其它特殊字符。
这个表包含某社交媒体 App 中所有的推文。</pre>

<p>&nbsp;</p>
Expand Down
2 changes: 1 addition & 1 deletion solution/1600-1699/1683.Invalid Tweets/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
| content | varchar |
+----------------+---------+
tweet_id is the primary key (column with unique values) for this table.
content consists of characters on an American Keyboard, and no other special characters.
content consists of alphanumeric characters, &#39;!&#39;, or &#39; &#39; and no other special characters.
This table contains all the tweets in a social media app.
</pre>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tags:

<pre>
<b>输入:</b>s = "(((())(((())", locked = "111111010111"
<b>输出:</b>false
<b>输出:</b>true
<b>解释:</b>locked 允许我们改变 s[6] 和 s[8]。
我们将 s[6] 和 s[8] 改为 ')' 使 s 变为有效字符串。
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Changing s[0] to either &#39;(&#39; or &#39;)&#39; will not make s valid.

<pre>
<strong>Input:</strong> s = &quot;(((())(((())&quot;, locked = &quot;111111010111&quot;
<strong>Output:</strong> false
<strong>Output:</strong> true
<strong>Explanation:</strong> locked permits us to change s[6] and s[8].
We change s[6] and s[8] to &#39;)&#39; to make s valid.
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:
<p>A string <code>s</code> can be partitioned into groups of size <code>k</code> using the following procedure:</p>

<ul>
<li>The first group consists of the first <code>k</code> characters of the string, the second group consists of the next <code>k</code> characters of the string, and so on. Each character can be a part of <strong>exactly one</strong> group.</li>
<li>The first group consists of the first <code>k</code> characters of the string, the second group consists of the next <code>k</code> characters of the string, and so on. Each element can be a part of <strong>exactly one</strong> group.</li>
<li>For the last group, if the string <strong>does not</strong> have <code>k</code> characters remaining, a character <code>fill</code> is used to complete the group.</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ tags:
- 数组
- 双指针
- 二分查找
- 枚举
- 前缀和
- 排序
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ tags:
- Array
- Two Pointers
- Binary Search
- Enumeration
- Prefix Sum
- Sorting
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source: 第 290 场周赛 Q3
tags:
- 树状数组
- 数组
- 哈希表
- 二分查找
- 排序
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source: Weekly Contest 290 Q3
tags:
- Binary Indexed Tree
- Array
- Hash Table
- Binary Search
- Sorting
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tags:

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/yetgriddrawio.png" style="width: 571px; height: 151px;" />
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/image1.png" style="width: 571px; height: 152px;" />
<pre>
<strong>Input:</strong> grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]
<strong>Output:</strong> [5,8,1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ tags:
<p><code>nums</code>&nbsp;的 <strong>串联值</strong>&nbsp;最初等于 <code>0</code> 。执行下述操作直到&nbsp;<code>nums</code>&nbsp;变为空:</p>

<ul>
<li>如果&nbsp;<code>nums</code>&nbsp;中存在不止一个数字,分别选中 <code>nums</code> 中的第一个元素和最后一个元素,将二者串联得到的值加到&nbsp;<code>nums</code>&nbsp;的 <strong>串联值</strong> 上,然后从&nbsp;<code>nums</code>&nbsp;中删除第一个和最后一个元素。</li>
<li>如果仅存在一个元素,则将该元素的值加到&nbsp;<code>nums</code> 的串联值上,然后删除这个元素。</li>
<li>如果&nbsp;<code>nums</code>&nbsp;的长度大于 1,分别选中 <code>nums</code> 中的第一个元素和最后一个元素,将二者串联得到的值加到&nbsp;<code>nums</code>&nbsp;的 <strong>串联值</strong> 上,然后从&nbsp;<code>nums</code>&nbsp;中删除第一个和最后一个元素。例如,如果&nbsp;<code>nums</code> 是 <code>[1, 2, 4, 5, 6]</code>,将 16 添加到串联值。</li>
<li>如果&nbsp;<code>nums</code>&nbsp;中仅存在一个元素,则将该元素的值加到&nbsp;<code>nums</code> 的串联值上,然后删除这个元素。</li>
</ul>

<p>返回执行完所有操作后<em>&nbsp;</em><code>nums</code> 的串联值。</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ tags:
<p>The <strong>concatenation value</strong> of <code>nums</code> is initially equal to <code>0</code>. Perform this operation until <code>nums</code> becomes empty:</p>

<ul>
<li>If there exists more than one number in <code>nums</code>, pick the first element and last element in <code>nums</code> respectively and add the value of their concatenation to the <strong>concatenation value</strong> of <code>nums</code>, then delete the first and last element from <code>nums</code>.</li>
<li>If one element exists, add its value to the <strong>concatenation value</strong> of <code>nums</code>, then delete it.</li>
<li>If <code>nums</code> has a size greater than one, add the value of the concatenation of the first and the last element to the <strong>concatenation value</strong> of <code>nums</code>, and remove those two elements from <code>nums</code>. For example, if the <code>nums</code> was <code>[1, 2, 4, 5, 6]</code>, add 16 to the <code>concatenation value</code>.</li>
<li>If only one element exists in <code>nums</code>, add its value to the <strong>concatenation value</strong> of <code>nums</code>, then remove it.</li>
</ul>

<p>Return<em> the concatenation value of the <code>nums</code></em>.</p>
<p>Return<em> the concatenation value of <code>nums</code></em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Each row contains information about transactions that includes unique (customer_

<p>Write an SQL query to find the customers who have made consecutive transactions with increasing <code>amount</code>&nbsp;for at least three consecutive days. Include the <code>customer_id</code>,&nbsp;start date of the consecutive transactions&nbsp;period and the end date of the consecutive transactions period. There can be multiple consecutive transactions by a customer.</p>

<p>Return <em>the result table ordered by</em> <code>customer_id</code> <em>in <strong>ascending</strong> order.</em></p>
<p>Return <em>the result table ordered by</em> <code>customer_id, consecutive_start, consecutive_end</code> <em>in <strong>ascending</strong> order.</em></p>

<p>The query result format is in the following example.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tags:
<li><code>1 &lt;= grid[i][j] &lt;= n * n</code></li>
<li>For all <code>x</code> that <code>1 &lt;= x &lt;= n * n</code> there is exactly one <code>x</code> that is not equal to any of the grid members.</li>
<li>For all <code>x</code> that <code>1 &lt;= x &lt;= n * n</code> there is exactly one <code>x</code> that is equal to exactly two of the grid members.</li>
<li>For all <code>x</code> that <code>1 &lt;= x &lt;= n * n</code> except two of them there is exatly one pair of <code>i, j</code> that <code>0 &lt;= i, j &lt;= n - 1</code> and <code>grid[i][j] == x</code>.</li>
<li>For all <code>x</code> that <code>1 &lt;= x &lt;= n * n</code> except two of them there is exactly one pair of <code>i, j</code> that <code>0 &lt;= i, j &lt;= n - 1</code> and <code>grid[i][j] == x</code>.</li>
</ul>

<!-- description:end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ tags:
<p><strong>解释:</strong></p>

<p>一个可能的字符串&nbsp;<code>t</code>&nbsp;为&nbsp;<code>"cdef"</code>&nbsp;,注意&nbsp;<code>t</code>&nbsp;可能等于&nbsp;<code>s</code>&nbsp;。</p>

<p><strong class="example">示例</strong><strong>&nbsp;3:</strong></p>

<p><strong>输入:</strong>s = "abcbcacabbaccba"</p>

<p><b>输出:</b>3</p>
</div>

<p>&nbsp;</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ tags:
<p>One possible string <code>t</code> could be <code>&quot;cdef&quot;</code>, notice that <code>t</code> can be equal to <code>s</code>.</p>
</div>

<p><strong class="example">Example 2:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;abcbcacabbaccba&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">3</span></p>
</div>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ tags:

<p>You are given an array <code>energy</code> and an integer <code>k</code>. Return the <strong>maximum</strong> possible energy you can gain.</p>

<p><strong>Note</strong> that when you are reach a magician, you <em>must</em> take energy from them, whether it is negative or positive energy.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

Expand Down
Loading