Update cachematrix.R

Solved programming assignement 2.