deno.land / x / masx200_leetcode_test@10.6.5 / reverse-linked-list / index.ts
1234567891011121314import { ListNode } from "./ListNode.ts";
export default function reverse_Linked_List( head: ListNode | null,): ListNode | null { let ans = null; let x = head; while (x != null) { ans = new ListNode(x.val, ans); x = x.next; } return ans;}
Version Info