Runtime Lab

test-case.json

Write minSubs(input) to return the contiguous subarray of length k with the smallest sum. Input is an object with numbers and k. If multiple subarrays share the same minimum sum, return the earliest one.

Input: {"numbers":[1,3,20,4,8,9,11],"k":3}
Output: [4,8,9]

Input: {"numbers":[4,4,4,4,8],"k":2}
Output: [4,4]
Minimum Sum Subarray

Authenticate to submit

Unlock the editor and runtime chart for this session.

i

Note: Your code runs on the server worker. Define function minSubs(input) { ... } and avoid infinite loops.

No data yet.

Waiting for a run.
Marked as cheater.
Submit a run to see per-test results and p50.
Overall p50 per item: -
No run started.
Test Status p50
Highscore (fastest p50 per item)
Entries matching the current task version
Rank Name Lang p50 Status Code Logged
1 K2 Go 0.382 ns Passed (20/20) 22:04 01/23/26
2 Zack Go 0.403 ns Passed (20/20) 12:45 01/26/26
3 K2 JS 0.458 ns Passed (20/20) 22:20 01/23/26
- Deniz Go 17.556 ns Passed (20/20) 10:13 01/30/26
- K2 Py 27.713 ns Passed (20/20) 22:15 01/23/26
- Zack JS Failed Failed (0/20) 21:30 01/23/26
- steve JS Failed Failed (0/20) 21:30 01/23/26
Stored on the server per task.