Update PenLift.py

The best solution should use union-find set.
And count the endpoints.