Updated cachematrix.R with solution