hard +35 pts

Insert value at index

Insert x at index i in a new list.

Implement `insert_at(values: list, i: int, x) -> list` inserting `x` at position `i`.

Constraints

0 ≤ list lengths ≤ 10_000 unless noted.

Example

>>> insert_at(...)
# see tests
35 points ~30 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.