无力吐槽这题。。。
class Solution:
def computeArea(self, A, B, C, D, E, F, G, H):
"""
:type A: int
:type B: int
:type C: int
:type D: int
:type E: int
:type F: int
:type G: int
:type H: int
:rtype: int
"""
le = max(A,E)
ri = max(min(C,G),le)
bt = max(B,F)
tp = max(min(D,H),bt)
return (C-A)*(D-B)+(G-E)*(H-F)-(ri-le)*(tp-bt)