Update cachematrix.R

My solution for the second programming assignment.