You are given an integer array nums of unique integers. Originally nums held every integer from some smallest value to some largest value, but some integers in between were removed. The smallest and largest integers are still present. Return the sorted list of all integers missing from nums between its smallest and largest values. If none are missing, return an empty list.
You are given an integer array nums of unique integers. Originally nums held every integer from some smallest value to some largest value, but some integers in between were removed. The smallest and largest integers are still present. Return the sorted list of all integers missing from nums between its smallest and largest values. If none are missing, return an empty list.
Example 1:
Input: {"nums":[1,4,2,5]}
Output: [3]
Constraints:
2≤nums.length≤100
1≤nums[i]≤100
All values in nums are unique.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"nums":[1,4,2,5]}
4 unique numbers. The gaps can only lie between the smallest and largest of them.