Skip to main content
added 38 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Python, 40 bytes

f=lambda x:x and[sum(x[:x[0]])]+f(x[1:])
f=lambda x:x and[sum(x[:x[0]])]+f(x[1:])

Test it on Ideone.

Python, 40 bytes

f=lambda x:x and[sum(x[:x[0]])]+f(x[1:])

Python, 40 bytes

f=lambda x:x and[sum(x[:x[0]])]+f(x[1:])

Test it on Ideone.

Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Python, 40 bytes

f=lambda x:x and[sum(x[:x[0]])]+f(x[1:])