Skip to main content
1 of 3
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 61 bytes

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