Hello,
If you still have warranty you may be able to get a replacement.
Identifying damaged AC power adapters or cables
If your power adapter, AC wall adapter, or AC power cable has been damaged, stop using it. If you're unsure about whether an accessory is damaged, take it to an Apple Retail Store or Apple Authorized Service Provider for evaluation, or contact Apple Support.
More info here:
Using Apple power adapters, cables, and duckheads with Apple products - Apple Support