Updated cachematrix.R

Updated cachematrix.R with solution (for Programming Assignment #2)