The TransCompilator

Solved LeetCode program · 416 of 1,000

#0561 · Array Partition

Easy Array chunk-09.md

Original English source

The numbers is a list of 1, 4, 3, and 2. Sort numbers. The last is the last position of numbers. The limit is last divided by 2. The total is 0.
For every pair from 0 to limit.
The spot is pair times 2. The value is item spot of numbers. Add value to total.

Show total.

Open in Playground Browse all 1,000 problems

Expected stdout

4