Update cachematrix.R

Added the answer code.