deno.land / x / masx200_leetcode_test@10.6.5 / VLNEbD / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { ListNode } from "../mod.ts";
export default function reContruct(head: ListNode | null): ListNode | null { if (!head) return null; const pre = new ListNode(-1, head); let cur: ListNode | null | undefined = pre; while (cur) { //console.log(cur) if (cur.next && cur.next.val % 2 === 0) { cur.next = cur.next.next; } else { cur = cur.next; } } return pre.next;}
masx200_leetcode_test

Version Info

Tagged at
a year ago