Frog Game

Problem Overview

  • Determine the maximum distance that can separate two frogs on a 1D array while moving under monotonic jump rules.
  • Input: array of block heights; Output: largest index gap achievable; frogs start on the same block and may move only to adjacent blocks of equal or greater height; no explicit constraints given.
  • Models movement on terrain/platforms where elevation restricts motion.
  • Microsoft interviews problem often used as a coding interview interview question and practice interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: