Given an array of distinct positive numbers, the task is to partition it into the minimum number of subsets such that each subset contains consecutive numbers. The problem can be solved using two approaches: sorting the array (O(n*log n) time) or hashing (O(n) time). The sorting approach counts breaks between consecutive numbers, while the hashing approach checks for consecutive subsequences and removes elements from the set. Both methods provide an efficient solution.
For more details, read the full article here.