The TransCompilator

Solved LeetCode program · 217 of 1,000

#0268 · Missing Number

Easy Array chunk-05.md

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.

Open in Playground Browse all 1,000 problems

Expected stdout

2