1572 Matrix Diagonal Sum LeetCode (Google Interview Question) JavaScript

Опубликовано: 09 Август 2026
на канале: dev alex
4,056
69

1572 Matrix Diagonal Sum LeetCode (Google Interview Question) JavaScript

https://leetcode.com/problems/matrix-...

"Given a square matrix mat, return the sum of the matrix diagonals.
Only include the sum of all the elements on the primary diagonal and all the elements on the secondary diagonal that are not part of the primary diagonal."

Final code:
https://replit.com/@AliaksandrMalko/1...

Gear I use:
1) Blue Yeti microphone - https://amzn.to/3ys9Te2
2) Logitech HD Pro Webcam C920 - https://amzn.to/3kuntZw
3) Monitor - https://amzn.to/3ynjJhe
4) Ipad - https://amzn.to/3BjoQAZ