# [1313. Decompress Run-Length Encoded List](https://leetcode.com/problems/decompress-run-length-encoded-list/)   /** * Note: The returned array must be malloced, assume caller calls free(). */ int* decompressRLElist(int* nums, int numsSize, int* returnSize){ int i, j, k=0; *returnSize = 0; for(i=0;i<numsSize;i+=2) { *returnSize += nums[i]; } int * a = (int *)calloc(*returnSize, sizeof(int)); for(i=0;i<numsSize;i+=2) { for(j=0;j<nums[i];j++) { a[k++] = nums[i+1]; } } return a; }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up