Caching the Inverse of a Matrix

The two functions below are used concurrently to find the inverse of a
matrix x.
If the inverse has already been found, it is returned without the need
to recalculate the inverse, thus, saves computing time.