Question 1: Coding solution
Eliminate uninteresting lines
Build up mapping table
Swap letters using mapping table