Find the missing number in an array from 1 to n.
MediumProblem Statement
Find the missing number in an array from 1 to n.
Sample Input
[1, 2, 4, 5], n = 5
Sample Output
3
Limits
Time: 2s · Memory: 256 MB
Find the missing number in an array from 1 to n.
[1, 2, 4, 5], n = 5
3
Time: 2s · Memory: 256 MB