def diagonalDifference(arr):
    """Calculate the absolute difference between the sums of a square matrix's diagonals.
 """
    size = len(arr)
    left_dia = 0
    right_dia = 0

    for i, j in zip(range(0, size), range(size - 1, -1, -1)):
        left_dia += arr[i][i]
        right_dia += arr[i][j]
    diff = abs(left_dia - right_dia)
    return diff