Search⌘ K
AI Features

Find the Corrupt Pair

Understand how to apply cyclic sort to detect the corrupt pair in an array where one number is duplicated and another is missing. Learn to find both numbers efficiently using in-place sorting within arrays constrained from 1 to n.

Statement

We are given an unsorted array, nums, with ...