You are viewing a single comment's thread. Return to all comments →
Crazy! I got the EXACT same. Important to note you have to pass n to the function.
n
def diagonalDifference(a,n) # Complete this function x = y = 0 for i in (0...n) x += a[i][i] y += a[i][n-1-i] end puts (x-y).abs end
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
Crazy! I got the EXACT same. Important to note you have to pass
n
to the function.