Create a table where stores . Base case: . This is only one step. For : . Jumping steps is jumping steps twice.
Build the table bottom-up. Store up to since you cannot jump more than steps without repeating in a cycle. This bounds the table size.
(Computing jump pointers)
Create a table where stores . Base case: . This is only one step. For : . Jumping steps is jumping steps twice.
Build the table bottom-up. Store up to since you cannot jump more than steps without repeating in a cycle. This bounds the table size.