Frog Jump Dynamic Program Solution in Java IDE. Vs Code. Full Code.

Veröffentlicht am: 21 November 2022
auf dem Kanal: DailyCodeUpdates
181
3

Hi Everyone ,
Please do like and subscribe

Please watch this at 1.5X speed. :-)

There is a frog on the 1st step of an N stairs long staircase. The frog wants to reach the Nth stair. HEIGHT[i] is the height of the (i+1)th stair.If Frog jumps from ith to jth stair, the energy lost in the jump is given by |HEIGHT[i-1] - HEIGHT[j-1] |.In the Frog is on ith staircase, he can jump either to (i+1)th stair or to (i+2)th stair. Your task is to find the minimum total energy used by the frog to reach from 1st stair to Nth stair.

For Example
If the given ‘HEIGHT’ array is [10,20,30,10], the answer 20 as the frog can jump from 1st stair to 2nd stair (|20-10| = 10 energy lost) and then a jump from 2nd stair to last stair (|10-20| = 10 energy lost). So, the total energy lost is 20.


Auf dieser Seite können Sie das Online-Video Frog Jump Dynamic Program Solution in Java IDE. Vs Code. Full Code. mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer DailyCodeUpdates 21 November 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 181 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!