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

Commitcee6c44

Browse files
authored
Adjust spacing
1 parent0c1a330 commitcee6c44

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎javascript/0861-score-after-flipping-matrix.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var matrixScore = function(grid) {
1414

1515
letstart=0;
1616
letcount=0;
17-
while(start<COL){
18-
if(!grid[start][col])count++;;
17+
while(start<COL){
18+
if(!grid[start][col])count++;
1919
start++;
2020
}
2121

@@ -25,36 +25,36 @@ var matrixScore = function(grid) {
2525
constflip=(i,isRow)=>{
2626
letstart=0;
2727

28-
if(isRow){
29-
while(start<ROW){
28+
if(isRow){
29+
while(start<ROW){
3030
grid[i][start]^=1;
3131
start++;
3232
}
3333
return;
3434
}
3535

36-
if(!isRow){
37-
while(start<COL){
36+
if(!isRow){
37+
while(start<COL){
3838
grid[start][i]^=1;
3939
start++;
4040
}
4141
return;
4242
}
4343
}
4444

45-
for(leti=0;i<COL;i++){
46-
if(!grid[i][0])flip(i,true);
45+
for(leti=0;i<COL;i++){
46+
if(!grid[i][0])flip(i,true);
4747

48-
for(letj=(grid[i][0]&&1);j<ROW;j++){
48+
for(letj=(grid[i][0]&&1);j<ROW;j++){
4949
constnumberOfZeros=countZeros(j);
50-
if(numberOfZeros>COL-numberOfZeros){
50+
if(numberOfZeros>COL-numberOfZeros){
5151
flip(j,false);
5252
}
5353
}
5454
}
5555

5656
lettotal=0;
57-
for(leti=0;i<COL;i++){
57+
for(leti=0;i<COL;i++){
5858
total+=parseInt(grid[i].join(""),2);
5959
}
6060

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp