We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
给出的实例代码中 内循环没有判断是否超过字符串长度,如果给出[]string{"flower", "flow", "flow"} 这样的输入直接就panic了。 建议修改为
for i := range firstStr { for j := 1; j < l; j++ { if len(arr[j]) == i || arr[j][i] != firstStr[i] { return firstStr[:i] } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
给出的实例代码中 内循环没有判断是否超过字符串长度,如果给出[]string{"flower", "flow", "flow"} 这样的输入直接就panic了。
建议修改为
The text was updated successfully, but these errors were encountered: