You are viewing a single comment's thread. Return to all comments →
Thanks for your solution.
I used yours because I couldn't import my numpy solution :P
arrNP = np.array(arr) arrNPDia1 = arrNP.diagonal() print(arrNPDia1) sum1 = sum(arrNPDia1) arrNPDia2 = np.diag(np.fliplr(arrNP)) print(arrNPDia2) sum2 = sum(arrNPDia2) # Calculate and Print Diff result = abs(sum1 - sum2) return result
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
Thanks for your solution.
I used yours because I couldn't import my numpy solution :P