Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- While the queue is nonempty, remove two bags at the end with fewer apples.
- Of these two bags, call the bag with more beets X, and the other Y.
- Throw X into either the Left or Right pile, whichever has FEWER beets.
- Throw Y into the other pile.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement