I don't know where you are in the world nor what kind of receptacles your power requires, but in our In our U.S. house, it is the wall outlets that are the issue. The original owner opted for cheap outlets and nearly all have required replacement. The contacts would seem to "go soft" and require some "creative positioning" ( A lot of duct tape and zip ties) to deliver consistent power. It is worse the devcie with rigid blades lin the MagSafe.
Wiggle the charge rin the outlet to see the charger goes on and off. I found the grounded, three-conductor extension cable helped with ill-behaved wall outlets:
Power Adapter Extension Cable - Apple
If the computer is still in warranty, so is the charger. If so, have Apple evaluate if the problem does not prove to be your house outlets.