implementation of week 3 exercise cacheMatrix,cacheSolve