Update cachematrix.R

Solution for PA2.