Skip to main content
Commonmark migration
Source Link

#Mathematica, 60 bytes

Mathematica, 60 bytes

Tr[Last@*Accumulate/@(#[[1]]2^(Range@Tr[1^#]-1)&/@Split@#)]&

#Mathematica, 60 bytes

Tr[Last@*Accumulate/@(#[[1]]2^(Range@Tr[1^#]-1)&/@Split@#)]&

Mathematica, 60 bytes

Tr[Last@*Accumulate/@(#[[1]]2^(Range@Tr[1^#]-1)&/@Split@#)]&
deleted 1 character in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 6160 bytes

Tr[Last@*Accumulate/@(#[[1]]2^Range[0,Tr[1^#]#[[1]]2^(Range@Tr[1^#]-1]&1)&/@Split@#)]&

#Mathematica, 61 bytes

Tr[Last@*Accumulate/@(#[[1]]2^Range[0,Tr[1^#]-1]&/@Split@#)]&

#Mathematica, 60 bytes

Tr[Last@*Accumulate/@(#[[1]]2^(Range@Tr[1^#]-1)&/@Split@#)]&
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 61 bytes

Tr[Last@*Accumulate/@(#[[1]]2^Range[0,Tr[1^#]-1]&/@Split@#)]&