Why the O(n) method is straightforward, could anybody tell me? Thank you!

In a sorted array of distinct elements:
A B C D E F G
If we swap B and F then we have:
A F C D E B G
We can see that the array is in ascending order until F and C, we record this and continue from C.
then at E and B we see the order if wrong again.
So we need to swap F (it is bigger so it comes from a later position) and B (it is smaller so it comes from a earlier position).There is a special case when we swap two neighbouring elements:
ACBDEFGwhere we will only detect the broken order once.