mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 21:46:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你两个数组,<code>arr1</code> 和 <code>arr2</code>,<code>arr2</code> 中的元素各不相同,<code>arr2</code> 中的每个元素都出现在 <code>arr1</code> 中。</p>\n\n<p>对 <code>arr1</code> 中的元素进行排序,使 <code>arr1</code> 中项的相对顺序和 <code>arr2</code> 中的相对顺序相同。未在 <code>arr2</code> 中出现过的元素需要按照升序放在 <code>arr1</code> 的末尾。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]\n<strong>输出:</strong>[2,2,2,1,4,3,3,9,6,7,19]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr1 = [28,6,22,8,44,17], arr2 = [22,28,8,6]\n<strong>输出:</strong>[22,28,8,6,17,44]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr1.length, arr2.length <= 1000</code></li>\n\t<li><code>0 <= arr1[i], arr2[i] <= 1000</code></li>\n\t<li><code>arr2</code> 中的元素 <code>arr2[i]</code> <strong>各不相同</strong> </li>\n\t<li><code>arr2</code> 中的每个元素 <code>arr2[i]</code> 都出现在 <code>arr1</code> 中</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 206,
|
||||
"likes": 207,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"71.3K\", \"totalSubmission\": \"100.8K\", \"totalAcceptedRaw\": 71295, \"totalSubmissionRaw\": 100801, \"acRate\": \"70.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"71.4K\", \"totalSubmission\": \"100.9K\", \"totalAcceptedRaw\": 71353, \"totalSubmissionRaw\": 100872, \"acRate\": \"70.7%\"}",
|
||||
"hints": [
|
||||
"Using a hashmap, we can map the values of arr2 to their position in arr2.",
|
||||
"After, we can use a custom sorting function."
|
||||
|
Reference in New Issue
Block a user