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
刚刚开始看leetcode,大家共勉。 第一题思路一 for (int i = 0; i < nums.length; ++i) { 是否应该是 i < nums.length - 1会更好
The text was updated successfully, but these errors were encountered:
不要钻牛角尖啦,那我还能说你每次循环都去算 nums.length -1 还消耗性能呢,我多走一重无效的 for 循环也比你多次运算好吧从最终生成的汇编来说,主要是思路,我也没说我的是最优解,优化得不能再优化,最终 AC 了,那这种思路就是对的,你要是这么钻,那我也没办法。
nums.length -1
Sorry, something went wrong.
No branches or pull requests
刚刚开始看leetcode,大家共勉。
第一题思路一
for (int i = 0; i < nums.length; ++i) {
是否应该是 i < nums.length - 1会更好
The text was updated successfully, but these errors were encountered: