Update cachematrix.R

final solution