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

Commit0a6c754

Browse files
authored
Merge pull requestneetcode-gh#294 from anushibin007/patch-2
Unnecessary multiplication by 3 creates confusion
2 parentscbf6195 +d78a3fc commit0a6c754

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎java/36-valid-sudoku.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public boolean isValidSudoku(char[][] board) {
1515

1616

1717
//Check whether Box contains duplicate elements in it
18-
if(h1.contains("box"+ (i/3)*3 +j/3 +board[i][j])){
18+
if(h1.contains("box"+ (i/3) +(j/3) +board[i][j])){
1919
returnfalse;
2020
}
21-
h1.add("box"+ (i/3)*3 +j/3 +board[i][j]);
21+
h1.add("box"+ (i/3) +(j/3) +board[i][j]);
2222
}
2323
}
2424
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp