Welcome to CTH
If you plug the charger in and have to hold it, maybe at an angle and it works then the
AC /DC plug on the motherboard is the problem, not the cord. This is a problem with many laptops. The AC/DC connector can be replaced, under $10 bucks if you can solder and take the lappy apart. A little more if you have to send out.
Looks like this: