Circular ArrayLoop


I used the same code in java, i tried the solution on leetcode its showing runtime error, kindly look into my code

hello @Akash23
add this two lines
image
this is done to convert each number in range -n+1 to n-1

It is still showing runtime error

yeah Now it works, Thankyou so much…And we have to do this in every question which have circular array or linkedlist?

in modulo related problem where elements can be negative