The Last Known Good
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
You're aligning two parallel columns from a sensor export, `left` and `right`, that can stop reporting at different points. Pair them position by position into `[left_i, right_i]` rows for as many positions as the longer column has, and when one column runs out partway, carry its last reported value forward to fill its side of the remaining rows. If a column is empty from the start there's no value to carry, so leave that side as `None`.
Summary
When a column goes quiet, its last reading keeps standing.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.