Linked list reasoning: The values array represents a singly linked list from head to tail. Remove the nth node from the end and return the remaining values.
Input: A JSON object { "values": number[], "n": number }.
Output: A JSON number[] containing the list after removal.
Constraints:
- 1 <= values.length <= 100000
- 1 <= n <= values.length
- Preserve the relative order of remaining values
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: MEDIUM. Variant: 20. Expect follow-up questions about complexity, edge cases, and alternative approaches.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked medium difficulty.
The signed-in workspace provides the tools required by the round, such a