You are viewing a single comment's thread. Return to all comments →
This one was fun.
rev_arr = [sublist[::-1] for sublist in arr] n = len(arr) l_to_r = [] r_to_l = [] for i in range(n): l_to_r.append(arr[i][i]) r_to_l.append(rev_arr[i][i]) result = abs(sum(l_to_r)-sum(r_to_l)) 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 →
My Python Solution
This one was fun.