Skip to main content
2 of 2
deleted 4 characters in body
Uriel
  • 13.2k
  • 4
  • 17
  • 45

Python, 76 72 bytes

f=lambda s,k=1:len(s)and(f(s,s[0])if s[0]*abs(k)/k-1else k+f(s[1:],2*k))

Try it online!

Uriel
  • 13.2k
  • 4
  • 17
  • 45