Skip to content

Commit 8906707

Browse files
committed
Time: 0 ms (100.00%), Space: 39.5 MB (42.17%) - LeetHub
1 parent 0f6ab4a commit 8906707

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
I:
3+
O:
4+
C:
5+
E:
6+
*/
7+
8+
class Solution {
9+
public int[] shuffle(int[] nums, int n) {
10+
int[] res = new int[nums.length];
11+
for(int i = 0,idx = 0; idx < nums.length; i++){
12+
13+
res[idx++] = nums[i];
14+
res[idx++] = nums[n];
15+
n++;
16+
17+
}
18+
return res;
19+
}
20+
}

0 commit comments

Comments
 (0)