Firmware Buffer Splice judge misses valid zeros in nums1

未關閉
#804 2 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@Chingyong0905 已經在處理了。

開始於 2026年11月21日。

  • #826 來自 @Chingyong0905 —— 未關閉

評估

這個 Issue 還沒有評估資料。

描述

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.
主要語言
Rust
星號
236
分支
153
平均合併
1 天 9 小時
30 天內合併 PR
187

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。