very clear appart from streams which I don't use yet, however you can remove the "else" after the return statement :
for (int i = 0; i < 3; i++) { if (board[i][0] == board[i][1] && board[i][1] == board[i][2] && board[i][0] > 0) return board[i][0]; if (board[0][i] == board[1][i] && board[1][i] == board[2][i] && board[0][i] > 0) return board[0][i]; if ((board[1][1] == board[0][0] && board[0][0] == board[2][2] && board[1][1] > 0) || board[1][1] == board[2][0] && board[2][0] == board[0][2] && board[1][1] > 0) return board[1][1]; } if (Arrays.stream(board).flatMapToInt(Arrays::stream).anyMatch(n -> n == 0)) return -1; return 0; }
dude I never thought of importing java.lang.Object
The Integer class already converts decimal to hex string. However if it didn't, I suggest you use switch(decimalDigit)
This comment is hidden because it contains spoiler information about the solution
Completely forgot you could multiply i in a for loop, this is the upgraded version of mine
Loading collection data...
very clear appart from streams which I don't use yet, however you can remove the "else" after the return statement :
dude I never thought of importing java.lang.Object
The Integer class already converts decimal to hex string. However if it didn't, I suggest you use switch(decimalDigit)
This comment is hidden because it contains spoiler information about the solution
Completely forgot you could multiply i in a for loop, this is the upgraded version of mine