Matrix exercise | 1st iteration