We have two sequence A and B with distinct integers and I have to make A equal to B. In one move i can either do one of the following things:
1) Change any element of A to any integer
2) cyclic right rotation of A
Then what would be the minimum moves required.
I am not getting anything. Can anybody please help me in this.
These two operations are comutative in a way. If you put an arrow at the first number in the sequence $A$ and then index the numbers relatively to this arrow which rotates together with the numbers, it doesn't matter if you rotate the array first or change the $n$-th number first. So you can do all rotations first and then all changes.
You try all possible rotations and for each rotation, you look how many numbers you have to change and add it up with the number of rotations you did. And then you pick the minimum of these possibilities.