SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 98 forks source link

Min Cost Climbing Stairs #414

Closed satyam878 closed 3 years ago

satyam878 commented 3 years ago

Issue Id you have worked upon -

408

Briefly explain your program logic -

just iterated over the loop and checked whether which one of the cost is minimum either i-1 or i-2 and adding it to sum accordingly then returning the answer accordingly

Screenshots(Attach 2 screenshots of your own input and output) -

image image


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

satyam878 commented 3 years ago

Kindly accept the pull request @SarthakKeshari