If power failed 3 times, thats 3 opportunities for the power to spike when it comes back on.
Take it to a shop and have them test the power supply unless you have or are willing to purchase a tester. The shop is better as they should be able to test your machine with a spare supply if your fails testing.
There may be more damage to the computer than just the power supply. If so a new supply is a waste of money. You would not know at that point how many of the other components are damaged. e.g. mother board, CPU, memory, etc. It would probably be more cost effective to replace. Unlessyou havethe time and spare parts available to determine the extent of the damage/failures?
But do check the power supplly first. With luck it is just the power supply. I have replaced the supplies in two different machines in the last 5 days.