Similarity Matrix Transformation — Coding problem | OneNoughtOne