Please Help..

Revision en1, by ramJha, 2021-09-12 09:57:23

You are given 'N' stairs and f,p,u,d where f=final postion to reach; p=initial position u=steps jump in forward direction; d=steps jump in backward direction; and cant go ouside the N stairs find the min steps required to reach from 'p' to 'f';

Ex: n=8 f=1 p=6 u=2 d=1

ans=4

explanation:

1->3->5->4->6

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ramJha 2021-09-12 09:57:23 389 Initial revision (published)