You are viewing a single comment's thread. Return to all comments →
That extra %N was added so that if our ans turns out to be greater than the number of elements in the array , the indexing should again start from index '0'.
eg. for m=1, our the later formula without using %N will result to 5.
but our ans should be equal to 0 and not 5 thats why we do modulus.
so that it could become 0