1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 07:21:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个整数数组 <code>nums</code> 和一个整数 <code>target</code> 。</p>\n\n<p>向数组中的每个整数前添加 <code>'+'</code> 或 <code>'-'</code> ,然后串联起所有整数,可以构造一个 <strong>表达式</strong> </p>\n\n<ul>\n\t<li>例如,<code>nums = [2, 1]</code> ,可以在 <code>2</code> 之前添加 <code>'+'</code> ,在 <code>1</code> 之前添加 <code>'-'</code> ,然后串联起来得到表达式 <code>\"+2-1\"</code> 。</li>\n</ul>\n\n<p>返回可以通过上述方法构造的、运算结果等于 <code>target</code> 的不同 <strong>表达式</strong> 的数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,1,1,1,1], target = 3\n<strong>输出:</strong>5\n<strong>解释:</strong>一共有 5 种方法让最终目标和为 3 。\n-1 + 1 + 1 + 1 + 1 = 3\n+1 - 1 + 1 + 1 + 1 = 3\n+1 + 1 - 1 + 1 + 1 = 3\n+1 + 1 + 1 - 1 + 1 = 3\n+1 + 1 + 1 + 1 - 1 = 3\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1], target = 1\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 20</code></li>\n\t<li><code>0 <= nums[i] <= 1000</code></li>\n\t<li><code>0 <= sum(nums[i]) <= 1000</code></li>\n\t<li><code>-1000 <= target <= 1000</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 1136,
"likes": 1174,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Expression Add Operators\", \"titleSlug\": \"expression-add-operators\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u7ed9\\u8868\\u8fbe\\u5f0f\\u6dfb\\u52a0\\u8fd0\\u7b97\\u7b26\"}]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"201.7K\", \"totalSubmission\": \"410.9K\", \"totalAcceptedRaw\": 201662, \"totalSubmissionRaw\": 410901, \"acRate\": \"49.1%\"}",
"stats": "{\"totalAccepted\": \"214.8K\", \"totalSubmission\": \"438.5K\", \"totalAcceptedRaw\": 214848, \"totalSubmissionRaw\": 438502, \"acRate\": \"49.0%\"}",
"hints": [],
"solution": null,
"status": null,