Update cachematrix.R

Solution to programming assignment 2