Largest Square Area in Cityscape

Asked at Visa · Coding Questions · Difficulty: Medium

You are analyzing the space in a cityscape outlined by a series of skyscrapers. Each skyscraper's height is an element of the array `cityline`; every skyscraper has width `1` and they are placed directly adjacent along a road with no gaps. Determine the **largest square area** that can fit within this row of skyscrapers.

Loading the problem…