CTCI 13.1 print last k lines of file