Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The if/elsif/else can be condensed down to simply:
total += dict[c] if dict[c] >= last else -dict[c]
To start the loop you know dict[c] can't be less than last. This removes the redundant code.
This doesn't really solve the Kata according to the instructions. What is the point of the push function in your implementation?
As bkaes said, you don't want to surprise the user by modifying the input list. Lists and dictionaries are examples of data types that are mutable, so when you change an input list in the local function space, you are also changing the input list in the caller space. This can be a useful feature of these data types, but requires special care sometimes.
Additionally, you could have just returned [lst[0], lst[-1]] instead of creating the tempor variable.
A bit dangerous because you have modified the input list using the .sort() method. Sorting a copy or creating a new list using sorted avoids this situation.