Equal Division of Square Area

Asked at Google · Coding Questions · Difficulty: Easy

Given a square, write a program to equally divide its area into n parts, where n is an integer. Provide the interface for the program, describing the input and output format, and implement the algorithm. Consider the input to be the side length of the square and the number of parts to divide into, and output the area of each part equally. Design the algorithm wisely and state the time and space complexity.

Loading the problem…