cachematrix. R

added my solution