Loading...
The Tail Trimmer
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
A data pipeline cleanup utility needs to remove a specific element from the end of a sequence without knowing the list length in advance. Given a list and a positive integer k, return the list with the k-th element from the end removed. If k is out of range, return the original list unchanged.
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.