Ladders Problem

How to solve this using DP?

@aiman.mumtazhttps:


scroll down for dp code and it also contains video explanation
dont forget to mark the doubt resolved if cleared :smiley: