Gratefully, I have never had this experience, but I do understand it.
Did you call this girl your friend? Did you do things with her a lot?
I would think it was good this girl walked away from you, not because you are a bad person, but because she was a freeloader. It's good you don't have to deal with her anymore.
Of course, I don't know the situation. Maybe she was nice to you and helped you with something in return for your snack. But from what you said about her, she doesn't sound like that.
Also, if someone asks for your answers on a test or homework, DON'T GIVE IT TO THEM! Not even if they are your best friend and they are paying for them! It is wrong to cheat, and if someone asks for your answers, you should dig and see if you should be their friend anymore. They don't deserve to have your answers, because they are asking for you to get in trouble for/with them. You could get in BIG trouble with your school if you cheat.
But, DO feel honored if someone does ask. They think you are smart :) ;)
I suggest you cry for a little while about this mean girl, but after that, just feel proud to have her off your hands.
And if she ever asks for your snack of answers again, give her a firm NO.
If she threatens you, talk to an adult such as teacher, principal, recess overseer, coach, any one who would be able to help you.
I hope this helps you, and I hope she leaves you alone.