CVS Health Interview Question

How to calculate R-squared value without using library?