We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a73b35 commit 2b46de3Copy full SHA for 2b46de3
Python/decompress-run-length-encoded-list.py
@@ -0,0 +1,10 @@
1
+# Time: O(n)
2
+# Space: O(1)
3
+
4
+class Solution(object):
5
+ def decompressRLElist(self, nums):
6
+ """
7
+ :type nums: List[int]
8
+ :rtype: List[int]
9
10
+ return [nums[i+1] for i in xrange(0, len(nums), 2) for _ in xrange(nums[i])]
0 commit comments