My LeetCode grinding. Trying to do a problem a day.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789101112
  1. class Solution:
  2. def runningSum(self, nums):
  3. run = 0
  4. res = []
  5. for x in nums:
  6. run = run + x
  7. res.append(run)
  8. return res
  9. s = Solution()
  10. print("Expected: [1, 2, 3, 4]")
  11. print("Got:", s.runningSum([1, 1, 1, 1]))