Given a list of integers forming an arithmetic progression (where the difference between consecutive elements is constant), your task is to find the missing element. However, the sequence provided is unsorted.
Complete the missing_number function. This function should take an unsorted list L as input and return the missing element in the sequence.
For example, if the input list is [4, 2, 6, 10, 12], the missing element is 8.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers20
Suggested Problems
-
Sum of first n terms of a harmonic progression
520 Solvers
-
Make a run-length companion vector
662 Solvers
-
617 Solvers
-
888 Solvers
-
685 Solvers
More from this Author53
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!