new solution for MaximalRectangle