Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

15. 3Sum #150

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
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.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.