medium +22 pts

Rotate list left by k

Move the first k nodes to the end (k may exceed length; use modulo).

Implement `rotate_left(values: list, k: int) -> list` rotating left by `k` positions.

Constraints

0 ≤ list lengths ≤ 10_000 unless noted.

Example

>>> rotate_left(...)
# see tests
22 points ~20 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Work on paper with a tiny list first.
Match the function signature exactly.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.