Solved LeetCode program · 217 of 1,000
#0268 · Missing Number
Original English source
The numbers is a list of 3, 0, and 1. The last is the last position of numbers. The size is last plus 1. The total is 0.
For each value in numbers.
Add value to total.
The expected is size times (size plus 1) divided by 2. Show expected minus total.
Expected stdout
2