<prompt> Generate an algorithm to find a missing number in an arrayarray 1, 2, 4, 5  <response>: One of the simplest and most efficient algorithms to find a missing number in an array is to calculate the expected sum of all elements in the array and subtract the actual sum of elements. Here is an algorithm that may help:1. Lets assume the input array is array of length n with elements ranging from 1 to n1 one element is missing.2. Calculate the sum of elements from 1 to n1 using the formula: expected_sum n1n22.3. Calculate the sum of the elements present in the array. Lets call it actual_sum. You can easily calculate the sum using a loop or the sum function in python.4. The missing number will be the difference between the expected sum and actual sum: missing_number expected_sum - actual_sum.5. Return the value of missing_number.pythonarray 1, 2, 4, 5def find_missing_numberarray: n lenarray expected_sum n1n22 actual_sum sumarray missing_number expected_sum - actual_sum return missing_numberprintfind_missing_numberarray Output: 3 