Zeus Learning Pvt. Ltd interview question

Rectangle problem