Firmware Buffer Splice judge misses valid zeros in nums1

Abierto
#804 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Chingyong0905 ya está trabajando en esto.

Desde el 21/11/2026.

  • #826 de @Chingyong0905 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
236
Forks
153
Merge medio
1 d 9 h
PR fusionados (30 d)
187

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/codetrial

Todos los issues de sysprog21/codetrial

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.