My LeetCode grinding. Trying to do a problem a day.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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]))