Skip to main content
added 4 characters in body
Source Link
Ginger
  • 6k
  • 1
  • 21
  • 54

Python, 84 8383 77 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum[sum(a[u-(2**len(bin(u+1).split("1")[-1])-1)+1:u+1]),for u in range(n))]

Attempt This Online!

Python, 84 83 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).split("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Python, 84 83 77 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:[sum(a[u-2**len(bin(u+1).split("1")[-1])+1:u+1])for u in range(n)]

Attempt This Online!

added 3 characters in body
Source Link
Ginger
  • 6k
  • 1
  • 21
  • 54

Python, 84 83 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).split("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Python, 84 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).split("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Python, 84 83 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).split("1")[-1])-1):u+1]),range(n))

Attempt This Online!

added 6 characters in body
Source Link
Ginger
  • 6k
  • 1
  • 21
  • 54

Python, 8484 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).rsplitsplit("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Python, 84 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).rsplit("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Python, 84 bytes

There's probably room for improvement here. Takes both the array and the length of the array, and returns a map.

lambda a,n:map(lambda u:sum(a[u-(2**len(bin(u+1).split("1")[-1])-1):u+1]),range(n))

Attempt This Online!

Source Link
Ginger
  • 6k
  • 1
  • 21
  • 54
Loading