Prototype: implement prototype(long[] loads, int width) returning List<Long> with a direct baseline.
Final: implement solve(long[] loads, int width) with the mechanism and bounds described above. Return each full window maximum in start order. Negative values and repeated maxima are valid. Empty input or width greater than length yields an empty list. Width <= 0 always raises IllegalArgumentException, even on empty input. Both stages have the same observable contract. The prototype may use the simpler method; final must use the target data structure.
All methods are static members of Exercise.
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…
Loading editor…
No results yet.
Complete the starter code, then run the checks.
Results and errors will appear here.
Java runs on this device with CheerpJ 4.3.