lundi 30 mars 2015

Find the number of steps required to reach at the top of ladder


I have one question, where i have to climb a ladder of N steps. I have to follow this rule to reach at the top of ladder 1. Take one step 2. Skip one 3. Take another step 4. Skip two steps.


and so on..till i reaches at top.


Algorithm to find the required number of steps i have to take to reach at the top of ladder.


Thanks




Aucun commentaire:

Enregistrer un commentaire