Skip to content
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

15. 3Sum #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

15. 3Sum #150

wants to merge 1 commit into from

Conversation

axross
Copy link
Owner

@axross axross commented Oct 12, 2019

No description provided.

@axross axross self-assigned this Oct 12, 2019

for (let i = 0; i < nums.length - 2; ++i) {
if (nums[i] > 0) break;
if (nums[i] === nums[i - 1]) continue;
Copy link
Owner Author

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected { after 'if' condition.

Suggested change
if (nums[i] === nums[i - 1]) continue;
if (nums[i] === nums[i - 1]) {continue;}

nums.sort((a, b) => a - b);

for (let i = 0; i < nums.length - 2; ++i) {
if (nums[i] > 0) break;
Copy link
Owner Author

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected { after 'if' condition.

Suggested change
if (nums[i] > 0) break;
if (nums[i] > 0) {break;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant