Matterport interview question

Given a rectangle set, find union area