Loading...

The Streak Breaker

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

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

Write a function that takes a list and removes consecutive duplicate values, keeping only the first element of each consecutive run. Non-consecutive duplicates should be preserved.

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.