You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Firmware Buffer Splice judge misses valid zeros in nums1 #804
In Firmware Buffer Splice, a Python solution that removes every zero from nums1 passes all five built-in tests.
With the same code, the custom case [[0, 2, 0], 2, [1], 1] fails. The result is [1, 2], but the expected result is [0, 1, 2].
Expected behavior
The built-in tests should reject solutions that discard a zero within the first m elements of nums1.
I’ll add this case to the built-in judge and verify that a correct in-place merge passes and the zero-dropping solution fails. Could you assign this issue to me?
Reproduction
Open Firmware Buffer Splice in Python 3 and paste this code:
On current upstream main (975075d), PYTHON=python ./scripts/test.sh rust is blocked on Windows before reaching the #804 changes. The unchanged tests/unit/server.rs:2 reports an unused std::sync::mpsc import under -D warnings. The #804 regression test passes, and the diff is limited to the judge source, generated judge, and browser regression. What is the expected way to complete the required local gate on Windows?
Accepted as scoped. Add [[0, 2, 0], 2, [1], 1] with expected [0, 1, 2] to problem-bank/judges.json under a label that does not name the shortcut, regenerate the derived files, and add a regression in tests/browser/compiler-explorer.test.js that runs your zero-dropping solution by name, looks the case up by its label and asserts the answer differs from expected, as the jump-game test does. The new label also goes in the tricky-case list in tests/web/contract.rs. The five built-in cases keep every zero outside the first m elements, which is why your solution passes them. Send it with Close #804.
Activity
Chingyong0905 commentedon Nov 22, 2026
On current upstream main (975075d), PYTHON=python ./scripts/test.sh rust is blocked on Windows before reaching the #804 changes. The unchanged tests/unit/server.rs:2 reports an unused std::sync::mpsc import under -D warnings. The #804 regression test passes, and the diff is limited to the judge source, generated judge, and browser regression. What is the expected way to complete the required local gate on Windows?
jserv commentedon Nov 23, 2026
Accepted as scoped. Add
[[0, 2, 0], 2, [1], 1]with expected[0, 1, 2]toproblem-bank/judges.jsonunder a label that does not name the shortcut, regenerate the derived files, and add a regression intests/browser/compiler-explorer.test.jsthat runs your zero-dropping solution by name, looks the case up by its label and asserts the answer differs fromexpected, as thejump-gametest does. The new label also goes in the tricky-case list intests/web/contract.rs. The five built-in cases keep every zero outside the firstmelements, which is why your solution passes them. Send it withClose #804.Reject merges that drop valid zeros