Loading...

The Horizon Scanner

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

Write a function that takes a list of integers and returns a list of the same length. For each element at index i, the result should be the first element to the right that is strictly greater. If no such element exists, use -1.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.