Explanationbynoob


#1

B[i] = A[i]; /this line copies the value 5 ,10 ,2 ,1 to B from A. Till now B has 4 elements

    B[i + A.size()] = A[(A.size() - i) % A.size()]     // this line starts writing the values into B from 5th element 

when i=0
A.size() -i % A.size =( 4-0) % 4 e.i 4%4 = 0
similarly value of [(A.size() - i) % A.size() will be 0 A[0] =1
3 A[3]=5
2 A[2]=2
1 A[1]=10


#2

A[0] = 5 in the array right,
then why you have written A[0]=1?