JPMorganChase Interview Question

Maximum index a pointer can reach in N steps by avoiding a given index B