The Unbroken Line
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L5
Problem
You're scanning a column of integer ids pulled from a data export, arriving unordered and with repeats. Return the length of the longest run of consecutive integers present anywhere in the column, where consecutive means each value is exactly one more than the one before it. An empty column has a longest run of zero.
Summary
Numbers that flow without interruption.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.