1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-09 17:31:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,4 +1,4 @@
<p>请你写一个函数&nbsp;<code>createCounter</code>. 这个函数接收一个初始的整数值 <code>init</code>&nbsp;&nbsp;并返回一个包含三个函数的对象。</p>
<p>请你写一个函数&nbsp;<code>createCounter</code>这个函数接收一个初始的整数值 <code>init</code>并返回一个包含三个函数的对象。</p>
<p>这三个函数是:</p>
@@ -13,8 +13,8 @@
<p><strong class="example">示例 1</strong></p>
<pre>
<b>输入:</b>init = 5, calls = ["increment","reset","decrement"]
<b>输出:</b>[6,5,4]
<strong>输入:</strong>init = 5, calls = ["increment","reset","decrement"]
<strong>输出:</strong>[6,5,4]
<strong>解释:</strong>
const counter = createCounter(5);
counter.increment(); // 6
@@ -25,8 +25,8 @@ counter.decrement(); // 4
<p><strong class="example">示例 2</strong></p>
<pre>
<b>输入:</b>init = 0, calls = ["increment","increment","decrement","reset","reset"]
<b>输出:</b>[1,2,1,0,0]
<strong>输入:</strong>init = 0, calls = ["increment","increment","decrement","reset","reset"]
<strong>输出:</strong>[1,2,1,0,0]
<strong>解释:</strong>
const counter = createCounter(0);
counter.increment(); // 1
@@ -42,5 +42,6 @@ counter.reset(); // 0
<ul>
<li><code>-1000 &lt;= init &lt;= 1000</code></li>
<li><code>总调用次数不会超过&nbsp;1000</code></li>
<li><code>0 &lt;= calls.length &lt;= 1000</code></li>
<li><code>calls[i]</code> 是 “increment”、“decrement” 和 “reset” 中的一个</li>
</ul>