This is the problem C of Codeforces Educational Round 95, called Mortal Kombat Tower. It uses Dynamic Programming to solve.
Dynamic Programming is one of the most important topics for interview point of view.

My code : https://codeforces.com/contest/1418/submission/94449843

Social Media:
LinkedIn: https://www.linkedin.com/in/subhampal/
Instagram: https://www.instagram.com/subhampalofficial/
Quora: https://www.quora.com/profile/Subham-Pal-10
Facebook: https://www.facebook.com/sirius1ight

#dynamicprogramming #codeforces #dp

source