god Blessing this permutationforcesa Random PebbleYou give permutation p_1p_2ldotsp_n length n positive integer k le n in operation choose index j 1 le j le n swap p_i p_jfind minimum number operation need sum p_1 p_2 ldot p_k small possibleA permutation array consist n distinct integer 1 n arbitrary order for example 23154 permutation 122 permutation 2 appear twice array 134 permutation n3 4 array