Goal
Goal: a task in termgrade-bandcentral-gemma4-31b-bash: TermGrade Band-Central: the 151-task selection and its splits (Harbor dataset). Implement a command-line tool /app/topk that reads a text file and outputs the k most frequent whitespace-delimited tokens, along with an approximate p -th…
The task
Implement a command-line tool `/app/topk` that reads a text file and outputs the `k` most frequent whitespace-delimited tokens, along with an approximate `p`-th percentile of their frequencies. The tool must stream the file (never load all tokens into memory at once) and use only bounded extra memory proportional to…