Skip to content

Firmware Buffer Splice judge misses valid zeros in nums1 #804

Description

@Chingyong0905

Observed behavior

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

  1. Open Firmware Buffer Splice in Python 3 and paste this code:

    class Solution:
        def spliceReadings(self, nums1: list[int], m: int, nums2: list[int], n: int) -> None:
            nums1[:] = sorted([x for x in nums1 if x != 0] + nums2[:n])
  2. Click Run tests. All five built-in tests pass.

  3. Open Add a case, enter [[0, 2, 0], 2, [1], 1] as Input JSON and [0, 1, 2] as Expected JSON, then click Add case.

  4. Click Run tests again. The built-in tests still show 5/5, but the custom case fails with [1, 2].

CodeTrial version

codetrial 0.1.0 (21c45b1)

Environment

OS: Windows
Browser: Chrome
Language: Python 3
Problem: Firmware Buffer Splice
REACTO step: Test

Sanitized evidence

Screenshot 2026-11-22 005419

Public data confirmation

  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.

Activity

  1. Chingyong0905 commented on Nov 22, 2026

    @Chingyong0905
    ContributorAuthor

    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?

  2. jserv commented on Nov 23, 2026

    @jserv
    Contributor

    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.

  3. added a commit that references this issue on Nov 23, 2026
    0ec81e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions