Solve cache matrix