@ srestha ,ma'am ,yeah both are almost same type but in that problem array is already given as sorted but in this question array is almost sorted so we have to sort first using insertion sort and also in this question asking only for every 2nd element follow the given property so we have to swap only one element at every 2nd element.