Skip to content

018.四数之和[Java] #25

New issue

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

Merged
merged 4 commits into from
Oct 18, 2018
Merged

018.四数之和[Java] #25

merged 4 commits into from
Oct 18, 2018

Conversation

Mrzhudky
Copy link
Contributor

018.四数之和 的 Java 代码

Copy link
Member

@yanglbme yanglbme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈喽,感谢提交哈,多了一个提交 Java 版本的小伙伴,开心。

刚刚看了提交信息和代码,在这里,我给一些小建议哈。

  • 代码需要规范化,该打空格的时候,就尽量不要少打空格哈。既然是 Java 代码,我们还是要按照 Java 的规范来写代码。e.g.
                List<List<Integer>> re = new ArrayList<>();
        if(nums == null || nums.length<4){
            return  re;
        }

以上代码显得有点乱,缩进,空格,都需要规范哈。

List<List<Integer>> re = new ArrayList<>();
if (nums == null || nums.length < 4) {
        return re;
}
  • 添加单行注释时,// 与后边注释之间统一有一个空格。
//当 nums[i] 对应的最小组合都大于 target 时,后面大于 nums[i] 的组合必然也大于 target,

上面注释需要修改为:

// 当 nums[i] 对应的最小组合都大于 target 时,后面大于 nums[i] 的组合必然也大于 target,
  • commit 提交代码时,备注信息请使用英文哈,蹩脚的英文也没关系。参考
018.四数之和[Java] // Wrong
  • 其它小点可以参考这个

一个仓库,需要靠大家共同维护,但同时需要有一个规范,规范文档/代码书写,规范提交,这样仓库维护起来才比较容易,不然的话,会比较混乱。如果你认可我的这些小建议,不妨修改一下再次提交,等你噢😄。

@yanglbme yanglbme added the need optimization Improvement request label Oct 17, 2018
Copy link
Member

@yanglbme yanglbme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤭

@yanglbme yanglbme merged commit ff7e4e9 into doocs:master Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need optimization Improvement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants