The TransCompilator

Solved LeetCode program · 245 of 1,000

#0328 · Odd Even Linked List

Medium Linked List chunk-05.md

Original English source

The values is a list of 1, 2, 3, 4, and 5. The last is the last position of values. The odds is an empty list of whole numbers. The evens is an empty list of whole numbers.
For every spot from 0 to last.
If spot modulo 2 is 0, Place item spot of values into odds. If spot modulo 2 is 1, Place item spot of values into evens.

For each value in odds, show value. For each value in evens, show value.

Open in Playground Browse all 1,000 problems

Expected stdout

1
3
5
2
4