A.get(4) will go out of index, coz to refer 4th and the last element of the array one shouyld write A.get(3)


how can A.get(A.size()-i) will give any output…? coz the A.get(4) does’nt exist…?


That is why we mod A.size()-i with A.size()
4%4 will give 0 so, A[0] will be used in that case