Skip to main content
deleted 8 characters in body
Source Link
mousetail 'he-him'
  • 13.5k
  • 1
  • 39
  • 85

Python, 10599 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if y in z or((zor[z:=z|{y:i})and(,y:=(y+x[y])%len(x))&0)]*0)

Attempt This Online!Attempt This Online!

Python, 105 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if y in z or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0))

Attempt This Online!

Python, 99 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if y in z or[z:=z|{y:i},y:=(y+x[y])%len(x)]*0)

Attempt This Online!

deleted 12 characters in body
Source Link
mousetail 'he-him'
  • 13.5k
  • 1
  • 39
  • 85

Python, 111105 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if z.get(y,-1)+1or in z or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0))

Attempt This Online!Attempt This Online!

Python, 111 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if z.get(y,-1)+1or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0))

Attempt This Online!

Python, 105 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if y in z or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0))

Attempt This Online!

deleted 10 characters in body
Source Link
mousetail 'he-him'
  • 13.5k
  • 1
  • 39
  • 85

Python, 117111 bytes

lambda x,y=0:(z:=,z={},:next(i-z[y]for i in range(len(x)+1)if z.get(y,-1)+1or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0)))[1]

Attempt This Online!Attempt This Online!

Python, 117 bytes

lambda x,y=0:(z:={},next(i-z[y]for i in range(len(x)+1)if z.get(y,-1)+1or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0)))[1]

Attempt This Online!

Python, 111 bytes

lambda x,y=0,z={}:next(i-z[y]for i in range(len(x)+1)if z.get(y,-1)+1or((z:=z|{y:i})and(y:=(y+x[y])%len(x))&0))

Attempt This Online!

deleted 4 characters in body
Source Link
mousetail 'he-him'
  • 13.5k
  • 1
  • 39
  • 85
Loading
Source Link
mousetail 'he-him'
  • 13.5k
  • 1
  • 39
  • 85
Loading