Solution R script for assignment 2

updated cachematrix.R file.