Test solve([[1,2,3],[3,4,6,6,7],[8,9,10,12,5,6]]),72) have a bug.
If we use a little combinatoric knowledge and some fingers we will see this bug.
Original values in each array: [3,4,6] Ok, let's multiply them, result 3 * 4 = 12 * 6= 72.
1 * 4 * 6 + 1 * 4 * 6 + 1 * 4 * 6 =72
But [1,2,3], [3,4,6,7],[8,9,10,12,5,6]
[1,3,[8,9,10,12,5,6]] = 6 23+23+17
[1,4,[8,9,10,12,5,6]] = 6
[1,6,[8,9,10,12,5]] = 5
[1,7,[8,9,10,12,5,6]] = 6
This is why, result( 23+23+17) should be 63
Following
you copied half of message
So, 3*4=72 ?
Because the bug can't fly.
Can't understand the idea of kata, why we can't go through the diagonals. It is the shortest way. In first test I got 3.74
Test solve([[1,2,3],[3,4,6,6,7],[8,9,10,12,5,6]]),72) have a bug.
If we use a little combinatoric knowledge and some fingers we will see this bug.
Original values in each array: [3,4,6] Ok, let's multiply them, result 3 * 4 = 12 * 6= 72.
But [1,2,3], [3,4,6,7],[8,9,10,12,5,6]
[1,3,[8,9,10,12,5,6]] = 6 23+23+17
[1,4,[8,9,10,12,5,6]] = 6
[1,6,[8,9,10,12,5]] = 5
[1,7,[8,9,10,12,5,6]] = 6
This is why, result( 23+23+17) should be 63
The perfect square for 9 is 16, 9+7, why we should add 16?
It isn't right description