Skip to content

Create 0410-split-array-largest-sum.js #2643

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 2 commits into from
Jul 11, 2023
Merged

Conversation

aadil42
Copy link
Contributor

@aadil42 aadil42 commented Jun 26, 2023

Solved split-array-largest-sum in JS.

File(s) Added: 0410-split-array-largest-sum.js
Language(s) Used: JavaScript
Submission URL: https://leetcode.com/problems/split-array-largest-sum/submissions/980074911/

Solved split-array-largest-sum in JS.
let right = nums.reduce((acc, num) => acc + num, 0);
let result = right;
while(left <= right) {
const mid = Math.floor((left+right)/2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion: Use Bitwise operator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Using the Bitwise operator to get middle value.
@aakhtar3 aakhtar3 merged commit e35eeaa into neetcode-gh:main Jul 11, 2023
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.

2 participants