PLEASE HELP ME WITH THIS RIDDLE
Both of my parents gave me 250$ each and now I have 500$ and then I bought a phone for 450$ and now I have 50 dollars left so i gave my friend 30 dollars because he asked. Now I have 20$ left. Since I have 20$ left I’ll give my parents 10$ each and now they want from me 240$ each and in total I have 480$ to give to my parents but my friend gave my 30$ dollars back that I gave him and now I have 510$ where did that 10$ in the 520$ come from??