Cover overshooting final hops in the judge

JE
5h ago
+120-1

Problem and behavior

The existing Drone Pad Hopping cases let a solution that always subtracts one final hop pass. For example, it returns 0 for [2,1], where the answer is 1.

Approach

Add three cases where the reachable range extends past the final pad, along with a regression test that checks each case rejects the reported solution. Regenerate the judge file and update the contract pins and golden digest.

Validation

node --test tests/browser/compiler-explorer.test.js: 108 passed, 0 failed, 0 skipped.

python3 scripts/gen-problems.py --check: passed.

./scripts/test.sh: completed in an ARM64 Linux VM with exit code 0 and no failed gates. Used ShellCheck 0.9.0 to match the Ubuntu 24.04 CI package.

Chromium/ffmpeg-dependent tests, cargo-audit, cargo-deny, and actionlint were skipped because the required tools were unavailable. The x86_64-only Clang-fetch test was also skipped.

Close #797


Summary by cubic

Closes a gap in the jump-game-ii judge that let incorrect solutions pass by always subtracting a final hop, such as returning 0 for [2, 1] when the answer is 1.

  • Adds three cases where the reachable range overshoots the final pad, each pinning the correct expected value.
  • Adds a browser regression test that checks each case accepts the correct greedy solution and rejects the reported final-hop subtraction, plus a contract entry for each.
  • Regenerates the judge file and updates the contract pins and golden digest.