Example #1
0
 def test1(self):
     M = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
     res = get_diagonal_sum(M)
     answer = [7, 12, 15, 8, 3]
     self.assertListEqual(answer, res)
     print res
Example #2
0
 def test2(self):
     M = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
     res = get_diagonal_sum(M)
     answer = [9, 15, 18, 21, 11, 4]
     self.assertListEqual(answer, res)
     print res