Company: epam

Difficulty: medium

Problem Statement

You are given a function or method that takes in the suspicious array of numbers. This detective tool will analyze the evidence and return a secret message containing both the duplicate and the missing number. Are you ready to crack the case and bring justice to the numbers? Let's get started! Constraints: 2 <= nums.length <= 10 4 1 <= nums[i] <= 10 4 Input Format: line 1 : space separated integer values Example 1: Input : 1 2 2 4 Output : 2 3 Explanation : The original set should have contained the numbers 1, 2, 3, and 4. However, the number 2 got duplicated, and the number 3 is missing. Therefore, the function should return [2, 3]. Example 2: Input : 3 1 2 5 2 Output : 2 4 Explanation : The original set should have contained the numbers 1, 2, 3, 4, and 5. However, the number 2 got duplicated, and the number 4 is missing. Therefore, the function should return [2, 4].

More epam OA questionsInterview experiences