1313. 解压缩编码列表
- 每两个相邻的数据 a是第奇数个 b是第偶数个 然后a个b
class Solution { public int[] decompressRLElist(int[] nums) { int size = 0; for(int i = 0; i < nums.length; i+=2){ size += nums[i]; } int arr[] = new int[size]; int index = 0; for(int i = 0; i < nums.length; i+=2){ int a = nums[i], b = nums[i+1]; for(int j = 0; j < a; j++){ arr[index++] = b; } } return arr; } }