Skip to main content
-1 byte
Source Link
corvus_192
  • 5.9k
  • 16
  • 26

Haskell, 3635 bytes

f a=[sum[1|x<a=[sum[1|j<-a,i<x]|i<i<=j]|i<-[0[1..a!!0-1]]0]] 

Attempt This Online!Attempt This Online!

-1 byte thanks to matteo_c

Basically a port of Command Master's python answer

Haskell, 36 bytes

f a=[sum[1|x<-a,i<x]|i<-[0..a!!0-1]] 

Attempt This Online!

Basically a port of Command Master's python answer

Haskell, 35 bytes

f a=[sum[1|j<-a,i<=j]|i<-[1..a!!0]] 

Attempt This Online!

-1 byte thanks to matteo_c

Basically a port of Command Master's python answer

Source Link
corvus_192
  • 5.9k
  • 16
  • 26

Haskell, 36 bytes

f a=[sum[1|x<-a,i<x]|i<-[0..a!!0-1]] 

Attempt This Online!

Basically a port of Command Master's python answer