you play game involve circular array nonzero integer num each numsi denote number indice forwardbackward locate index iif numsi positive numsi step forward andif numsi negative numsi step backwardsince array circular assume move forward element put element move backwards element put elementA cycle array consist sequence index seq length k wherefollowing movement rule result repeat index sequence seq0 seq1 seqk 1 seq0 every numsseqj positive negativek 1return true cycle num false Example 1input num 21122output trueexplanation the graph show index connect White node jump forward red jumping backwardWe cycle 0 2 3 0 node white jump directionexample 2input num 123456output falseexplanation the graph show index connect White node jump forward red jumping backwardThe cycle size 1 return falseexample 3input num 11514output trueexplanation the graph show index connect White node jump forward red jumping backwardWe cycle 0 1 0 size 1 node jump forward node jump backward cycleWe cycle 3 4 3 node white jumping direction Constraints1 numslength 50001000 numsi 1000numsi 0 follow could solve on time complexity o1 extra space complexity