Added code to solve a matrix (inverse of a matrix) and cache the matrix and its inverse.