The Unbroken Line
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L5
Problem
You're scanning one column of id values pulled from a data export, where each cell is raw text, the ids arrive in the order they were written, and values repeat. The export wrote ids inconsistently, so the same id can show up with extra leading zeros ('7' and '007' are one id), and you read each cell by its numeric value. Return the length of the longest unbroken stretch of the column in which no id appears more than once.
Summary
The longest stretch that never repeats itself.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.