Construct The Rectangle Leetcode Python