IntermediateJavaScript

Find the missing number in an array

Write a function that finds the missing number in an array of integers from 1 to n.

Examples

Input: [1, 2, 4, 5]

Output: 3

Your Solution

Output

Click 'Run Code' to see the output