You must implement a command-line tool at /usr/local/bin/topk that reads a text file and outputs the top-K…
You must implement a command-line tool at /usr/local/bin/topk that reads a text file and outputs the top-K…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input contract: - The tool receives two arguments: the file path and K (a positive integer). - The file is a…
The task
**Input contract:** - The tool receives two arguments: the file path and K (a positive integer). - The file is a UTF-8 text file containing tokens separated by any combination of spaces, tabs, CR, LF, or CRLF. The file can be arbitrarily large (do not load the entire file into memory at once). - Tokens can be any…
Part of ai-and/termgrade-environments.