My solution to Transporting Snacks problem