First of all thanks. I used your solution to troubleshoot mine. And while doing so I found that your solution for part2 challenge(python one) does not cover some specific cases. Feel free to ignore. But in case you were interested I just wanted to leave you an example.
A slightly altered testing example from the problem description:
7,1
11,1
11,7
9,7
9,5
2,5
2,3
7,3
7,2
3,2
3,1
Should return 35