greyireland / greyireland/algorithm-pattern
文章中有一处代码有缺陷
- Ngôn ngữ chính
- Go
- Star
- 15.5k
- Fork
- 2.6k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
文件地址:algorithm-pattern/introduction/quickstart.md
问题strStr,问题代码:
```
func strStr(haystack string, needle string) int {
if len(needle) == 0 {
return 0
}
....
}
```
如果子串长度为0的话返回0有歧义,误认为子串起始地址为0,我觉得改为负数之类的更好。
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go
- Lĩnh vực
- documentation
- Loại issue
- Lỗi
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100