Written code for cacheMatrix to store inverse of matrix