My LeetCode grinding. Trying to do a problem a day.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.py 267B

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