Assignment solution cachematrix.R