Give a permutatation with no two consecutive integers next to each other – codegolf.stackexchange.com

Challenge Given an integer n ≥ 4, output a permutation of the integers [0, n-1] with the property that no two consecutive integers are next to each other. Examples 4 → [1, 3, 0, 2] 5 → [0, 2, 4, 1, ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Give a permutatation with no two consecutive integers next to each other – codegolf.stackexchange.com"