From e3342b4ea3c4730b362dfc344144c49cf361b9dc Mon Sep 17 00:00:00 2001 From: "d.kapustin" Date: Wed, 4 Oct 2023 17:43:17 +0300 Subject: [PATCH] =?UTF-8?q?6.7.3.=20=D0=9C=D0=B0=D1=81=D1=81=D0=B8=D0=B2?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=B4=D0=B8=D0=B0=D0=B3=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BC=D0=B0=D1=82=D1=80=D0=B8=D1=86=D1=8B;=20ht?= =?UTF-8?q?tps://job4j.ru/profile/exercise/2/task-view/114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ru/j4j/array/MatrixCheck.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/ru/j4j/array/MatrixCheck.java b/src/main/java/ru/j4j/array/MatrixCheck.java index b3537db..b64ffe9 100644 --- a/src/main/java/ru/j4j/array/MatrixCheck.java +++ b/src/main/java/ru/j4j/array/MatrixCheck.java @@ -22,11 +22,7 @@ public static boolean monoVertical(char[][] board, int column) { public static char[] extractDiagonal(char[][] board) { char[] boardChars = new char[board.length]; for (int i = 0; i < board.length; i++) { - for (int j = 0; j < board[i].length; j++) { - if (board[i][j] != ' ') { - boardChars[i] = board[i][j]; - } - } + boardChars[i] = board[i][i]; } return boardChars; }