Rectangle class solution