I chose the following challenge from LeetCode: https://leetcode.com/problems/construct-the-rectangle/ and gave it a try.
f interested please follow the link to get the requirements.
The following is a screen capture of the console using the sample data:
area: 4 = [L: 2 W: 2]
Please note that the challenge only requires the method constructRectangle(). The test cases were generated by me.
Additional output from the console for additional tests follows: Continue reading “Construct the Rectangle”