Haneunhanlee.hashnode.dev·Jul 3, 2024LeetCode 2319. Check if Matrix Is X-Matrix Java SolutionProblem Description Problem: Check if Matrix is X-Matrix Description: Determine if a given square matrix is an X-matrix. An X-matrix has all elements zero except those on the main diagonal and the anti-diagonal. Approach Idea: To check if each e...2319. Check if Matrix Is X-Matrix
Haneunhanlee.hashnode.dev·Jul 1, 20222319. Check if Matrix Is X-MatrixProblem Problem_Link My Attempt Brainstorming X-Matrix All the elements in the diagonals of the matrix are non-zero. All other elements are 0. So, it need to have 0 in all positions. num, 0,0,0,num 0,num,0,num,0 0,0,num,0,0 0,num,0,num,0 num...44 readsAlgorithm Solving Studyleetcode