Both will work to achieve your desired result. However, the former (fasting) will be done at some great discomfort to you.
Also, since fasting is not a maintainable lifestyle you tend to pick the weight right back up once you resume eating.
Your best bet would be to engage in some cardio exercise to burn off the excess calories and then do lighter exercises like walking regularly to maintain your new weight.