FrogJmp  problem solved.

Space complexity O(1)
Temp complexity O(1)