Subject: PHP

Find Missing Number in Array

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

Example:
Input: [1, 2, 4, 5]
Output: 3

Select file or drag and drop

PNG, JPG, SVG

Preview