Implement tail -n (print last N lines of a file)

Problem: Implement tail -n

Given a text file, print the last N lines of the file. Lines are separated by the newline character \n.

Input

  • Line 1: integer N (number of last lines to...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: