Update cachematrix.R

Inserting solution to program assignment 2.