Runtime Lab
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.
No run started.
| Test | Status | p50 |
|---|
Entries matching the current task version
| Rank | Name | Lang | p50 | Status | Code | Logged |
|---|---|---|---|---|---|---|
| No entries in this category. | ||||||
Stored on the server per task.