Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Python, 95 91 bytes

This is a Python implementation of nimi's Haskell answernimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z==[]or(z[0]+len(z)-1)*f([i-1for i in z if~-i])
p=lambda z:z==[]or f(z)*p(z[1:])

Python, 95 91 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z==[]or(z[0]+len(z)-1)*f([i-1for i in z if~-i])
p=lambda z:z==[]or f(z)*p(z[1:])

Python, 95 91 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z==[]or(z[0]+len(z)-1)*f([i-1for i in z if~-i])
p=lambda z:z==[]or f(z)*p(z[1:])
More golfing
Source Link
Sherlock9
  • 12.3k
  • 1
  • 30
  • 68

Python, 9595 91 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z andz==[]or(z[0]+len(z)-1)*f([i-1for i in z if~-i])or 1
p=lambda z:z andz==[]or f(z)*p(z[1:])or 1

Python, 95 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z and(z[0]+len(z)-1)*f([i-1for i in z if~-i])or 1
p=lambda z:z and f(z)*p(z[1:])or 1

Python, 95 91 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z==[]or(z[0]+len(z)-1)*f([i-1for i in z if~-i])
p=lambda z:z==[]or f(z)*p(z[1:])
Source Link
Sherlock9
  • 12.3k
  • 1
  • 30
  • 68

Python, 95 bytes

This is a Python implementation of nimi's Haskell answer. Golfing suggestions welcome.

f=lambda z:z and(z[0]+len(z)-1)*f([i-1for i in z if~-i])or 1
p=lambda z:z and f(z)*p(z[1:])or 1