Example 1
Input:
5
1 2 3 4 5
2
Output: 1 2 3 5
Example 2
Input:
5
1 2 3 4 5
5
Output: 2 3 4 5
n, where counting begins at 1 from the list's end.n positions from the tail, then return the resulting head node.fast is n nodes ahead of slow. In interviews, communicating this reasoning is often evaluated more heavily than the implementation itself.