Skip to main content
deleted 22 characters in body
Source Link
Ajax1234
  • 7.7k
  • 1
  • 15
  • 28

Python3, 116102 bytes:

lambda x,c=0:min([i for i in range(lenv(x),c)ifand vc)or(x,i)]+[len and f(x,c+1)])
v=lambda x,i:len(x)<=i or(sum(x[:i])==x[i]and v(x[1:],i))

Try it online!Try it online!

Python3, 116 bytes:

lambda x:min([i for i in range(len(x))if v(x,i)]+[len(x)])
v=lambda x,i:len(x)<=i or(sum(x[:i])==x[i]and v(x[1:],i))

Try it online!

Python3, 102 bytes:

lambda x,c=0:(v(x,c)and c)or(x and f(x,c+1))
v=lambda x,i:len(x)<=i or(sum(x[:i])==x[i]and v(x[1:],i))

Try it online!

Source Link
Ajax1234
  • 7.7k
  • 1
  • 15
  • 28

Python3, 116 bytes:

lambda x:min([i for i in range(len(x))if v(x,i)]+[len(x)])
v=lambda x,i:len(x)<=i or(sum(x[:i])==x[i]and v(x[1:],i))

Try it online!