Twice on the Wire
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior
Problem
A card reader retransmits its last status ping whenever an ACK is dropped, so the raw stream arrives with the same status repeated back to back. Collapse each run of consecutive identical pings into a single entry, keeping the surviving pings in their original order.
Summary
A dropped ACK makes the reader say it again. Keep the signal, drop the echo.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.