solution to jump using linear space