Skip to content

Commit 513461b

Browse files
authored
Create 1470. Shuffle the Array
1 parent d0fb76e commit 513461b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

1470. Shuffle the Array

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public:
3+
vector<int> shuffle(vector<int>& nums, int n) {
4+
vector<int>v;
5+
//v.push_back(nums[0]);
6+
for(int i=0; i<n; i++){
7+
v.push_back(nums[i]);
8+
v.push_back(nums[i+n]);
9+
}
10+
return v;
11+
}
12+
};

0 commit comments

Comments
 (0)