leetcode

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

1313.cpp (304B)


      1 class Solution {
      2   public:
      3     vector<int> decompressRLElist(vector<int> &nums) {
      4         vector<int> res;
      5 
      6         for (int i = 0; i < size(nums); i += 2) {
      7             for (int j = 0; j < nums[i]; j++) {
      8                 res.push_back(nums[i + 1]);
      9             }
     10         }
     11 
     12         return res;
     13     }
     14 };