Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 348 Bytes

README.md

File metadata and controls

12 lines (8 loc) · 348 Bytes

<< [01] Interleave the elements of a stack using a queue >>

Given a stack of N elements, interleave the first half of the stack with the second half reversed using one other queue.

Example:

>>> coding_problem_01([1, 2, 3, 4, 5])
[1, 5, 2, 4, 3]

>>> coding_problem_01([1, 2, 3, 4, 5, 6])
[1, 6, 2, 5, 3, 4]