Search
⌘K

Leetcode 634. Find the Derangement of An Array

Given an array, produce a permutation (derangement) of its elements such that no element remains in its original index, or indicate that no such derangement exists. The core challenge is handling duplicates and avoiding fixed points (derangement is impossible if any value appears more than n/2), typically solved with frequency balancing or rotating grouped elements.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.