# Leetcode 319 - Perfect rectangle

Note:

• Two conditions must be met to form a perfect rectangle:
• Total area = sum of every little rectangle
• The 4 vertexes must only appear once.
• Every other vertex must only appear twice or 4 times.

Question:

Given an array rectangles where rectangles[i] = [xi, yi, ai, bi] represents an axis-aligned rectangle. The bottom-left point of the rectangle is (xi, yi) and the top-right point of it is (ai, bi).

Return true if all the rectangles together form an exact cover of a rectangular region.

Example:

Code: