Find the Missing Number

Advanced

Description

In this fun challenge, you are a detective trying to uncover the secret number that has gone missing from an otherwise complete series of numbers. Your task is to write a function called find_missing_number that will help solve the mystery!

You are provided with a list of numbers that should ideally contain all numbers from 1 to n (inclusive), but one number has mysteriously disappeared! Your mission is to find that missing number.

Example

Let's play detective with some examples:

find_missing_number([3, 7, 1, 2, 8, 4, 5])

The above list should contain all numbers from 1 to 8. However, if you take a closer look, you will notice that number 6 is missing! So, the function should return:

6
find_missing_number([1, 2, 4, 6, 3, 7, 8])

In this list, number 5 is missing. Thus, the function should return:

5

Now, let's uncover some missing numbers!

Geek
Inputs

Arg 1:

[3,7,1,2,8,4,5]
Expected Output
6
Actual Output
Find the Missing Number [advanced] | Coding for Kids