Back to problems

Find Missing and Repeated Element

Algorithm · Akuna Capital · Medium

Requirements This junior-level phone-screen question focuses on one task: an array is intended to contain every integer from 1 through n, but one number is absent and a different number appears twice. Return both values. Implement the function below. Report the missing value first and the duplicated value second. Create your own test cases before discussing the implementation. The interview also expects you to compare more than one mathematical technique. Examples Example 1…

Checking your access…