Your machine should have same ports. You can't charge your machine with its USB 3.1 Type-C™ Gen 1 (Data Transfer up to 5 Gb/s, DP1.2, HP Sleep and Charge) port only. You need an USB-C port which supports power delivery and a compatible charger.
BH *** **Click the KUDOS thumb up on the left to say 'Thanks'** Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".