Skip to main content
added 54 characters in body
Source Link
totallyhuman
  • 17.3k
  • 3
  • 32
  • 88

Haskell, 7575 73 bytes

-2 bytes thanks to Joseph Sible.

f i|e<-length i=last[(s,l)|l<-[0..length i]e],s<-[0..length ie-l],0==sum(take l$drop s i)]

Try it online!

Outputs first index and length as a tuple.Try it online!

Haskell, 75 bytes

f i=last[(s,l)|l<-[0..length i],s<-[0..length i-l],0==sum(take l$drop s i)]

Try it online!

Outputs first index and length as a tuple.

Haskell, 75 73 bytes

-2 bytes thanks to Joseph Sible.

f i|e<-length i=last[(s,l)|l<-[0..e],s<-[0..e-l],0==sum(take l$drop s i)]

Try it online!

Source Link
totallyhuman
  • 17.3k
  • 3
  • 32
  • 88

Haskell, 75 bytes

f i=last[(s,l)|l<-[0..length i],s<-[0..length i-l],0==sum(take l$drop s i)]

Try it online!

Outputs first index and length as a tuple.