[Python] 3016. Minimum Number of Pushes to Type Word II