Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commitd011e91

Browse files
authored
Update 0410-split-array-largest-sum.js
Using the Bitwise operator to get middle value.
1 parent6178329 commitd011e91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎javascript/0410-split-array-largest-sum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var splitArray = function(nums, k) {
1313
letright=nums.reduce((acc,num)=>acc+num,0);
1414
letresult=right;
1515
while(left<=right){
16-
constmid=Math.floor((left+right)/2);
16+
constmid=(left+right)>>1;
1717
if(canSplit(mid)){
1818
result=mid;
1919
right=mid-1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp