inverse mtx function

coursera - ASS 2