Make some changes to the code: first, take file input instead of hard-coding the input array. Next, for each movement, repeatedly apply movements to the tail until it is within a Manhattan distance of 1 from the head.