Ramesh's solution to cacheInverseMatrix