Judging from the comments of your duplicate question, there are two things which could be causing problems. These are common issues because people often put their laptop in a carrying bag with the AC adapter connected and it puts excessive side pressure on the connector or wire.
- The AC adapter has a broken wire or connector. Sometime this is obvious by the condition of the wire or actual broken insulation around the connector.
- The connector on the laptop is damaged (where the AC adapter plugs in). This is usually indicated by a very loose connection where the AC adapter connects to the laptop.
You may want to have a professional look at it to ensure you know which item needs to be replaced.