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