1 line solution using C++


  • 1
    E

    return (C-A)(D-B)+(G-E)(H-F)-max(min(min(G-A,C-E),min(G-E,C-A)),0)*max(min(min(D-F,H-B),min(D-B,H-F)),0);


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.