greyireland / greyireland/algorithm-pattern

文章中有一处代码有缺陷

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
15.5k
Forks
2.6k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

文件地址:algorithm-pattern/introduction/quickstart.md

问题strStr,问题代码:

```
func strStr(haystack string, needle string) int {
if len(needle) == 0 {
return 0
}
....
}
```

如果子串长度为0的话返回0有歧义,误认为子串起始地址为0,我觉得改为负数之类的更好。

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Open algorithm-pattern/introduction/quickstart.md and inspect the strStr example. Check how an empty needle is defined by the surrounding explanation or referenced problem, then clarify the returned value so it cannot be mistaken for a valid starting index. Update the example and verify the documented behavior is unambiguous.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
go
Área
documentation
Tipo de issue
Error
Dificultad
1/5
Tiempo estimado
Menos de una hora
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.