Implement Prototype(weights []int, days int) (int,error) by testing capacities; Solve binary-searches the first feasible capacity. Preserve order and partition positive weights into at most days nonempty contiguous groups. Extra days may remain unused. Empty weights returns zero for positive days. Nonpositive days or weights return error. Use O(1) auxiliary space; sums fit int.

Edit exercise.go; retain the public types and signatures. prototype and final are separate stages. The executable tests recover panics as failures, report named checks, and exit nonzero on any failure. A successful run must execute at least one check. Tests use logical time or explicit synchronization where relevant.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.