#Leetcode

Опубликовано: 29 Октябрь 2024
на канале: The Exception Handler
249
17

Here is the solution to "Matrix Diagonal Sum " leetcode question. Hope that you will like the way I have explained the solution.

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..


******* Table of content *******
00:00 Understanding the problem statement
02:30 Understanding what is primary and secondary diagonal
05:49 Understanding the approach to find elements of diagonal
11:32 Algo
13:51 Understanding algo with examples
18:52 Final code in Golang
21:36 Calculating Time and space complexity
23:43 Thank you

Matrix Diagonal sum
Facebook Coding Interview question,
google coding interview question,
leetcode solution
Matrix Diagonal Sum Golang

#leetcode #leetcodesolution #1572 #matrixdiagonalsum #Amazon #Facebook #CodingInterview #Google #golang #go #golangprogramming #dsa #theexceptionhandler