Skip to content

Commit b1fabc2

Browse files
committed
feat(5364): ✨整理 5364
1 parent 22e5513 commit b1fabc2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Rank/181/5364/solution1.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* https://leetcode-cn.com/problems/create-target-array-in-the-given-order/submissions/
3+
*
4+
* 5364. 按既定顺序创建目标数组
5+
*
6+
* Easy
7+
*
8+
* 72ms 100.00%
9+
* 34mb 100.00%
10+
*/
11+
const createTargetArray = (nums, index) => {
12+
const target = [];
13+
for (let i = 0, max = nums.length; i < max; i++) {
14+
target.splice(index[i], 0, nums[i]);
15+
}
16+
return target;
17+
}

0 commit comments

Comments
 (0)