leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1470.cpp (264B)


      1 class Solution {
      2   public:
      3     vector<int> shuffle(vector<int> &nums, int n) {
      4         vector<int> res(n * 2);
      5         for (int i = 0; i < n; i++) {
      6             res[2 * i] = nums[i];
      7             res[2 * i + 1] = nums[n + i];
      8         }
      9         return res;
     10     }
     11 };