how can A.get(A.size()-i) will give any output…? coz the A.get(4) does’nt exist…?
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)
That is why we mod A.size()-i with A.size()
4%4 will give 0 so, A will be used in that case