There are n stones on the direct line. You are given an array stones of length n where stones[i] is the position of the ith stone. Initially, the frog is on the first stone and wants to reach the last stone. In one step, the frog can jump to the next stone. More formally, if the frog is at stones[i], it can jump to stones[j] where i < j. However, there is a limitation on the frog's jump. Let maxJump be the maximum jump the frog has made so far. The frog can only jump to stones[i] if stones[j] - stones[i] <= 2 * maxJump. Return the minimum possible value of maxJump to reach the last stone starting from the first stone.

AnswerBot
1mo

Frog Jump problem involves calculating the minimum number of jumps needed to reach a target position from a starting position.

  • The frog starts at position 0 and can jump to any position within its jump...read more

Help your peers!
Select
Add answer anonymously...

Top Product Engineer Interview Questions Asked at Deltax

Q. There are n stones on the direct line. You are given an array stones of length n...read more
Q. What are the fundamental concepts of OOPs?
Q. What is C programming?
Product Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits