done
Java:
Missing fixed tests
Should be upgraded to JUnit5
Reference solution should be private
private
Fixed.
Merged.
fixed
For the record, OPs wrong solution is:
public class Solution{ public static String diagonal(int[][] matrix){ System.out.println(matrix[0][0]+" "+matrix[0][1]+" "+matrix[0][2]); System.out.println(matrix[1][0]+" "+matrix[1][1]+" "+matrix[1][2]); System.out.println(matrix[2][0]+" "+matrix[2][1]+" "+matrix[2][2]); System.out.println(matrix[0][0] + matrix[2][2] > matrix[0][2] + matrix[2][0] ? "Principal Diagonal win!" : matrix[0][0] + matrix[2][2] < matrix[0][2] + matrix[2][0] ? "Secondary Diagonal win!" : "Draw!"); return matrix[0][0] + matrix[2][2] > matrix[0][2] + matrix[2][0] ? "Principal Diagonal win!" : matrix[0][0] + matrix[2][2] < matrix[0][2] + matrix[2][0] ? "Secondary Diagonal win!" : "Draw!"; } }
Example input it fails is:
matrix = [ [1, 6, 1, 4, 9] [7, 2, 6, 2, 9] [1, 4, 8, 6, 5] [1, 6, 0, 1, 4] [1, 2, 5, 4, 1] ]
Your solution is shit broken, it can handle only matrices of size 3x3. It returns wrong result for matrices larger than 3x3.
Not a kata issue.
Shit ain't working
5 0 4 9 2 0 3 6 4 Principal Diagonal win!
right? according to the rules, it is. according to the random tests, secondary wins here though...
cool
PHP fork to fix this issue and enable PHP 8.
This comment is hidden because it contains spoiler information about the solution
python new test framework is required. updated in this fork
Current state of C++ initial solution setup compiles correctly, closing!
OP solved it, closing
And you're starting with $arr[0], so in your loop you can skip first element by starting to count from $i = 1.
Loading collection data...
done
Java:
Missing fixed tests
Should be upgraded to JUnit5
Reference solution should be
private
Fixed.
Merged.
fixed
For the record, OPs wrong solution is:
Example input it fails is:
Your solution is
shitbroken, it can handle only matrices of size 3x3. It returns wrong result for matrices larger than 3x3.Not a kata issue.
Shit ain't working
5 0 4
9 2 0
3 6 4
Principal Diagonal win!
right? according to the rules, it is. according to the random tests, secondary wins here though...
cool
PHP fork to fix this issue and enable PHP 8.
This comment is hidden because it contains spoiler information about the solution
python new test framework is required. updated in this fork
Current state of C++ initial solution setup compiles correctly, closing!
OP solved it, closing
And you're starting with $arr[0], so in your loop you can skip first element by starting to count from $i = 1.
Loading more items...