Travelfusion interview question

remove any redundant code in the block of code