startIndex
is the target. If yes, return 0.rightSteps
and leftSteps
, to 0.startIndex
, incrementing rightSteps
until the target is found or we return to startIndex
.startIndex
, incrementing leftSteps
until the target is found or we return to startIndex
.rightSteps
and leftSteps
.-1
.