Construct Diagonal Matrix from Vector - Coding problem | OneNoughtOne