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

Commit b1558dd

Browse files
authored
Improved task 1275
1 parent e25de96 commit b1558dd

File tree

1 file changed

+2
-4
lines changed
  • src/main/java/g1201_1300/s1275_find_winner_on_a_tic_tac_toe_game

1 file changed

+2
-4
lines changed

‎src/main/java/g1201_1300/s1275_find_winner_on_a_tic_tac_toe_game/Solution.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ public String tictactoe(int[][] moves) {
2222
private String wins(String[][] board) {
2323
for (int i = 0; i < 3; i++) {
2424
if (board[i][0] == null) {
25-
break;
25+
continue;
2626
}
2727
String str = board[i][0];
2828
if (str.equals(board[i][1]) && str.equals(board[i][2])) {
2929
return getWinner(str);
3030
}
3131
}
32-
3332
for (int j = 0; j < 3; j++) {
3433
if (board[0][j] == null) {
35-
break;
34+
continue;
3635
}
3736
String str = board[0][j];
3837
if (str.equals(board[1][j]) && str.equals(board[2][j])) {
3938
return getWinner(str);
4039
}
4140
}
42-
4341
if (board[1][1] == null) {
4442
return "";
4543
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /