# Check if Matrix Is X-Matrix (LeetCode 3142) Practice note for coding interviews. ## Approach Union-Find with path compression for connectivity queries. ## Complexity State time and space clearly; call out edge cases (empty input, duplicates, extremes). ## Practice tip Rehearse the explanation out loud. An [the Linkjob AI app](https://www.linkjob.ai/) helps keep structure under time pressure. Disclosure: personal study notes; I am affiliated with Linkjob AI.