CodeForces - 863F Almost Permutation

NoSuchKey