day_23/AoC_2020_23.cpp
void insert_after(cup* after, cup* picked)
{
    auto last = after->next;
    after->next = picked;

    while (picked->next)
        picked = picked->next;

    picked->next = last;
}
// Insert the non-circular list of cups after the given cup
// which is in a circular list. Keep the resulting list circular.
Insert the non-circular list of cups after the given cup
which is in a circular list. Keep the resulting list circular.
Insert the non - circular list of cups after the given cup which is in a circular list . Keep the resulting list circular .
void insert_after(cup* after, cup* picked)
{
    auto last = after->next;
    after->next = picked;
    while (picked->next)
        picked = picked->next;
    picked->next = last;
}
void insert_after ( cup * after , cup * picked ) { auto last = after -> next ; after -> next = picked ; while ( picked -> next ) picked = picked -> next ; picked -> next = last ; }
Insert the non-circular list of cups after the given cup
which is in a circular list.
Insert the non - circular list of cups after the given cup which is in a circular list .