Finding two missing number in 1 to n array - MATLAB Cody - MATLAB Central

Problem 43558. Finding two missing number in 1 to n array

Difficulty:Rate

You are given an array of numbers from 1 to n with two missing numbers.

Return the two missing numbers.

Input: x=[5 2 0 1 0]; %n=5

Output: y=[3 4]; % [4 3] is not accepted

Have fun.

Solution Stats

65.09% Correct | 34.91% Incorrect
Last Solution submitted on Jul 19, 2025

Solution Comments

Show comments

Problem Recent Solvers65

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!