Firmware Buffer Splice judge misses valid zeros in nums1

Aberta
#804 2 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@Chingyong0905 já está trabalhando nisso.

Desde 21/11/2026.

  • #826 de @Chingyong0905 — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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.
Linguagem predominante
Rust
Estrelas
236
Forks
153
Merge médio
1d 9h
PRs com merge (30d)
187

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de sysprog21/codetrial

Todas as issues de sysprog21/codetrial

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.