Firmware Buffer Splice judge misses valid zeros in nums1

Offen
#804 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Chingyong0905 arbeitet bereits daran.

Seit 21.11.2026.

  • #826 von @Chingyong0905 — offen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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.
Vorherrschende Sprache
Rust
Sterne
236
Forks
153
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
187

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus sysprog21/codetrial

Alle Issues in sysprog21/codetrial

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.