## Linear Twin Towers of Hanoi

This is a mix between both the Split and Interleaved problems, and the linear problem. We are given two stacks of disks, on three pegs. We are expected to swap the stacks' position while respecting the classical Hanoi movement restrictions (one disk at a time, and no large disk over smaller disks) and the linear movement restriction (no direct exchange between the left-most and right-most pegs).

You will use three recursive functions:

- moveDouble(k,from, to): moves an interleaved stack of k pairs of disks, without changing the relative positions of disks of the same size. As in the Split Hanoi problem, an interleaved stack alternates white and black disks of each sizes. This function is not completely new: you wrote a version with 4 pegs (but using only 3 of them) for the first version of the Split Hanoi problem.
- gather(k): from the initial split situation, build on peg #2 an interleaved stack of k pairs of disks. You may parametrize your function so that it can be used to gather the disk on any peg passed as parameter, but in practice, your function will only be used to gather on the last peg.
- scatter(k): from a situation where k pairs of disks are interleaved on peg #0, split it down by moving the white disks to peg #1 and black ones to peg #2.

In `gather()`, the recursive call comes before two calls to `moveDouble()` while in `scatter()`, the calls to `moveDouble()` come before the recursive call. The main function that you should write is not recursive, but simply gather almost all disks, moves directly the remaining disks, and then scatters back the small disks.

The linearity naturally induces some extra complexity as you have to decompose every move between pegs 0 and 2. I am still confident in your ability to overcome the challenge :)

Note that the requested algorithm was proved optimal for that problem, so you don't need to fiddle the performance this time.