You are given an integer array nums that originally contained all the numbers from n, where n is the length of nums. Due to an error, one number in the collection was duplicated, causing another number to be missing.
Find the number that occurs twice and the number that is missing, and return them as an array in the format [duplicate, missing].
Constraints:
nums.length
nums[i]
You are given an integer array nums that originally contained all the numbers from n, where n is the length of nums. Due to an error, one number in the collection was duplicated, causing another number to be missing.
Find the number that occurs twice and the number that is missing, and return them as an array in the format [duplicate, missing].
Constraints:
nums.length
nums[i]