nth from the end (1-based), and return the head of the updated list. You may assume n is always valid.n apart finds the correct position from the end in one pass.nth from the end (1-based), and return the head of the updated list. You may assume n is always valid.// Run your code to see the output here.