Problem 634 · Medium

Find the Derangement of An Array

Count permutations in which no element stays in its original position. The visual shows the recurrence building up from small sizes and the chain of swapped positions.

Open the interactive visualisation