1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11: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

@@ -17,7 +17,9 @@
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> actions = [&quot;Calculator&quot;, &quot;add&quot;, &quot;subtract&quot;, &quot;getResult&quot;], values = [10, 5, 7]
<strong>Input:</strong>
actions = [&quot;Calculator&quot;, &quot;add&quot;, &quot;subtract&quot;, &quot;getResult&quot;],
values = [10, 5, 7]
<strong>Output:</strong> 8
<strong>Explanation:</strong>
new Calculator(10).add(5).subtract(7).getResult() // 10 + 5 - 7 = 8
@@ -26,7 +28,9 @@ new Calculator(10).add(5).subtract(7).getResult() // 10 + 5 - 7 = 8
<p><strong class="example">Example 2:</strong></p>
<pre>
<strong>Input:</strong> actions = [&quot;Calculator&quot;, &quot;multiply&quot;, &quot;power&quot;, &quot;getResult&quot;], values = [2, 5, 2]
<strong>Input:</strong>
actions = [&quot;Calculator&quot;, &quot;multiply&quot;, &quot;power&quot;, &quot;getResult&quot;],
values = [2, 5, 2]
<strong>Output:</strong> 100
<strong>Explanation:</strong>
new Calculator(2).multiply(5).power(2).getResult() // (2 * 5) ^ 2 = 100
@@ -35,7 +39,9 @@ new Calculator(2).multiply(5).power(2).getResult() // (2 * 5) ^ 2 = 100
<p><strong class="example">Example 3:</strong></p>
<pre>
<strong>Input:</strong> actions = [&quot;Calculator&quot;, &quot;divide&quot;, &quot;getResult&quot;], values = [20, 0]
<strong>Input:</strong>
actions = [&quot;Calculator&quot;, &quot;divide&quot;, &quot;getResult&quot;],
values = [20, 0]
<strong>Output:</strong> &quot;Division by zero is not allowed&quot;
<strong>Explanation:</strong>
new Calculator(20).divide(0).getResult() // 20 / 0
@@ -47,9 +53,11 @@ The error should be thrown because we cannot divide by zero.
<p><strong>Constraints:</strong></p>
<ul>
<li><code>actions</code> is a valid JSON array of strings</li>
<li><code>values</code>&nbsp;is a valid JSON array of numbers</li>
<li><code>2 &lt;= actions.length &lt;= 2 * 10<sup>4</sup></code></li>
<li><code>1 &lt;= values.length &lt;= 2 * 10<sup>4</sup></code><code>&nbsp;- 1</code></li>
<li><code>actions[i] is one of &quot;Calculator&quot;, &quot;add&quot;, &quot;subtract&quot;, &quot;multiply&quot;, &quot;divide&quot;, &quot;power&quot;, and&nbsp;&quot;getResult&quot;</code></li>
<li><code><font face="monospace">Last action is always &quot;getResult&quot;</font></code></li>
<li><code><font face="monospace">values is a JSON array of numbers</font></code></li>
<li><code>1 &lt;= values.length &lt;= 2 * 10<sup>4</sup>&nbsp;- 1</code></li>
<li><code>actions[i]</code> is one of &quot;Calculator&quot;, &quot;add&quot;, &quot;subtract&quot;, &quot;multiply&quot;, &quot;divide&quot;, &quot;power&quot;, and&nbsp;&quot;getResult&quot;</li>
<li>First action is always &quot;Calculator&quot;</li>
<li>Last action is always &quot;getResult&quot;</li>
</ul>