Can't find an approach to solve unlock problem

i am unable to solve the problem and cannot find any way to do it

think of a greedy approack, swap the biggest element at the first place, than swap the second biggest element at second place and keep updating positions of all the elements