Rosetta Problems

Nearer Permutation

https://atcoder.jp/contests/agc058/tasks/agc058_e