Skip to content
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

chore: update lc problems #2051

Merged
merged 1 commit into from
Dec 2, 2023
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/2700-2799/2756.Query Batching/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p>The constructor should accept two parameters:</p>

<ul>
<li>An asyncronous function&nbsp;<code>queryMultiple</code>&nbsp;which accepts an array of&nbsp;string keys <code>input</code>. It will resolve with an array of values that is the same length as the input array. Each index corresponds to the value associated with&nbsp;<code>input[i]</code>.&nbsp;You can assume the promise will never reject.</li>
<li>An asynchronous function&nbsp;<code>queryMultiple</code>&nbsp;which accepts an array of&nbsp;string keys <code>input</code>. It will resolve with an array of values that is the same length as the input array. Each index corresponds to the value associated with&nbsp;<code>input[i]</code>.&nbsp;You can assume the promise will never reject.</li>
<li>A throttle time in milliseconds&nbsp;<code>t</code>.</li>
</ul>

Expand Down
44 changes: 23 additions & 21 deletions solution/2900-2999/2950.Number of Divisible Substrings/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# [2950. Number of Divisible Substrings](https://leetcode.cn/problems/number-of-divisible-substrings)
# [2950. 可整除子串的数量](https://leetcode.cn/problems/number-of-divisible-substrings)

[English Version](/solution/2900-2999/2950.Number%20of%20Divisible%20Substrings/README_EN.md)

## 题目描述

<!-- 这里写题目描述 -->

<p>Each character of the English alphabet has been mapped to a digit as shown below.</p>
<p>每个英文字母都被映射到一个数字,如下所示。</p>

<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2900-2999/2950.Number%20of%20Divisible%20Substrings/images/old_phone_digits.png" style="padding: 10px; width: 200px; height: 200px;" /></p>

<p>A string is <strong>divisible</strong> if the sum of the mapped values of its characters is divisible by its length.</p>
<p>如果字符串的字符的映射值的总和可以被字符串的长度整除,则该字符串是 <strong>可整除</strong> 的。</p>

<p>Given a string <code>s</code>, return <em>the number of <strong>divisible substrings</strong> of</em> <code>s</code>.</p>
<p>给定一个字符串 <code>s</code>,请返回 <code>s</code><em> <strong>可整除子串</strong> 的数量</em></p>

<p>A <strong>substring</strong> is a contiguous non-empty sequence of characters within a string.</p>
<p><strong>子串</strong> 是字符串内的一个连续的非空字符序列。</p>

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

<p><strong class="example">示例 1:</strong></p>

<table border="1" cellspacing="3" style="border-collapse: separate; text-align: center;">
<tbody>
Expand Down Expand Up @@ -102,35 +103,36 @@
</table>

<pre>
<strong>Input:</strong> word = &quot;asdf&quot;
<strong>Output:</strong> 6
<strong>Explanation:</strong> The table above contains the details about every substring of word, and we can see that 6 of them are divisible.
<b>输入:</b>word = "asdf"
<b>输出:</b>6
<b>解释:</b>上表包含了有关 word 中每个子串的详细信息,我们可以看到其中有 6 个是可整除的。
</pre>

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

<pre>
<strong>Input:</strong> word = &quot;bdh&quot;
<strong>Output:</strong> 4
<strong>Explanation:</strong> The 4 divisible substrings are: &quot;b&quot;, &quot;d&quot;, &quot;h&quot;, &quot;bdh&quot;.
It can be shown that there are no other substrings of word that are divisible.
<b>输入:</b>word = "bdh"
<b>输出:</b>4
<b>解释:</b>4 个可整除的子串是:"b","d","h","bdh"。
可以证明 word 中没有其他可整除的子串。
</pre>

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

<pre>
<strong>Input:</strong> word = &quot;abcd&quot;
<strong>Output:</strong> 6
<strong>Explanation:</strong> The 6 divisible substrings are: &quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;ab&quot;, &quot;cd&quot;.
It can be shown that there are no other substrings of word that are divisible.
<b>输入:</b>word = "abcd"
<b>输出:</b>6
<b>解释:</b>6 个可整除的子串是:"a","b","c","d","ab","cd"。
可以证明 word 中没有其他可整除的子串。
</pre>

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

<p><b>提示:</b></p>

<ul>
<li><code>1 &lt;= word.length &lt;= 2000</code></li>
<li><code>word</code> consists only of lowercase English letters.</li>
<li><code>word</code> 仅包含小写英文字母。</li>
</ul>

## 解法
Expand Down