Spectral Analysis of a Square Matrix — Coding problem | OneNoughtOne