You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
s := "hello world abc is a test chars in program develop comm"
index := strStrSunday(s, "common")
fmt.Println("common index is", index)
正常应该返回-1, 实际会返回54 什么的
附上根据原链接java 版本实现的一个方法:
`
func strStrSunday(haystack string, needle string) int {
if len(haystack) < len(needle) {
return -1
}
s := "hello world abc is a test chars in program develop comm"
index := strStrSunday(s, "common")
fmt.Println("common index is", index)
正常应该返回-1, 实际会返回54 什么的
附上根据原链接java 版本实现的一个方法:
`
func strStrSunday(haystack string, needle string) int {
if len(haystack) < len(needle) {
return -1
}
}
`
The text was updated successfully, but these errors were encountered: