solution cachmatrix assignment

complete