Implemented the cacheMatrix() and cacheSolve() functions.