HF RL Explorer

Goal

Goal: a task in TermGrade Environments: 1,004 executable Linux tasks (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 percentile of their frequencies. The tool must stream…

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…

Part of ai-and/termgrade-environments.