Update cachematrix.R

solution to the solution for the assignment cachematrix.