AIRSATM / My-progress

0 stars 0 forks source link

Shuffle the Array #4

Open AIRSATM opened 4 hours ago

AIRSATM commented 4 hours ago

class Solution { public: vector shuffle(vector& nums, int n) { vector ans; // create array where we are going to save value for(int i=0; i<n; i++){ ans.push_back(nums[i]); //starting to add at first ans.push_back(nums[i+n]); //then we add after at previous } return ans; } };