Construct the Rectangle Problem
Construct the Rectangle Problem — ExecCode Easy DSA Practice
Solve the Construct the Rectangle problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given the input needed to solve Construct the Rectangle. Your task is to compute the required answer and return an array [L, W] where L and W are the length and width of the web page you designed in sequence. A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements: 1. The area of the rectangular web page you designed must equal to the given target area.
Examples
Input {"area": 4}; Output [2, 2]. Input {"area": 37}; Output [37, 1]
Constraints
1 <= area <= 10^7
Practice Construct the Rectangle free on ExecCode. Browse DSA problems, topic map, and placement guides.