Hi bonbon242,
I don't know if I understand your problem, but I think that if position is 4 and a.length()=3, you want return at the first element of your array.
For me, if you use mod function, you...