Dot Product of Diagonals This challenge is very simple. You are given as input a square matrix, represented in any sane way, and you have to output the dot product of the diagonals of the matrix.
The diagonals in specific are the diagonal running from top-left to bottom-right and from top-right to bottom-left.
Test Cases
[[-1, 1], [-2, 1]]  -&gt;  -3
[[824, -65], [-814, -741]]  -&gt;  549614
[[-1, -8, 4], [4, 0, -5], [-3, 5, 2]]  -&gt;  -10
[[0, -1, 0], [1, 0, 2], [1, 0, 1]]  -&gt;  1
Jelly, 8 6 bytes

×UŒDḢS


Try it online! or verify all test cases

How it works

×UŒDḢS  Main link. Argument: M (matrix)

 U      Upend M, i.e., reverse each row.
,       Pair M and upended M.
  ŒD    Yield all diagonals.
    Ḣ   Head; extract the first, main diagonal.
     S  Reduce by sum.