HF RL Explorer

Create a Python script /app/topk.py that reads a large input file of unsigned 64-bit integers (one per line…

Create a Python script /app/topk.py that reads a large input file of unsigned 64-bit integers (one per line…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). where K is a positive integer ( =1). The input file can be arbitrarily large (up to ~10 GB) and may contain…

The task

where K is a positive integer (>=1). The input file can be arbitrarily large (up to ~10 GB) and may contain duplicates, blank lines, lines with leading/trailing whitespace, non-numeric lines, and lines with values outside the 0..2^64-1 range. The script must handle all these edge cases correctly and efficiently…

Part of ai-and/termgrade-environments.