Solution to R Programming Assignment 2

Calculates the inverse of a vector / tests whether the inverse of a
vector has already been calculated (to make the function more efficient
by avoiding unnecessary calculations)