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
第一个if文改成下面这种形式,避免了最后一个字母和target是同值的情况
//如果 target大于等于数组中最大的字母大,那么返回第一个字母 if (target >= letters[len-1]) { return letters[0]; }
那么下面这一步可以省略
if (mid + 1 == len) { return letters[0]; }
大概可以快1ms左右
The text was updated successfully, but these errors were encountered:
No branches or pull requests
第一个if文改成下面这种形式,避免了最后一个字母和target是同值的情况
那么下面这一步可以省略
大概可以快1ms左右
The text was updated successfully, but these errors were encountered: