Solutions for A. Part Elf and B. Reordering Train Cars