Databricks interview question

find maximal square from histogram.