The input “nums” is supposed to be an array of unique integers ranging from 1 to nums.length. However there is a mistake: one of the number in the array is duplicated, which means another number is missing. Find and return the sum of the duplicated number and the missing number. Example: In the array [4,…