Update cachematrix.R

Solution for R Programming Assignment 2