Skip to content

Conversation

@jhm9595
Copy link
Owner

@jhm9595 jhm9595 commented Sep 25, 2022

Time Complexity : O(NM)

if (minAbs > Math.abs(target - sum)) {
minAbs = Math.abs(target - sum);
threeSum = sum;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider storing Math.abs(target - sum) in a variable here to remove duplicate code.

@bigelephant29
Copy link
Collaborator

Time Complexity should be O(N^2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants