Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Denys Stopkin
Task lacks constraints or is incorrect

Denys Stopkin

Jul 20, 2025

Either I don't understand the task or it's incorrect (incomplete). Example array: {3,2,-2,5,6}. The last value gives a circle itself since it goes through the whole array's available index range twice. [0, 1, 2, 3, 4 ] + 6 = 10 10 - arr.size() = 5, which is greater than allowed index is 5 - arr.size() = 0. And here we have circled through the array twice already. Does it mean that this particular example should return true?

In the same case if we start form 2 the sequence would prove the circle exists before the loop would be found

0

0

Comments
Comments

On this page