deno.land / x / masx200_leetcode_test@10.6.5 / intersection-of-two-linked-lists / test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { assertEquals } from "../deps.ts";import { ListNode } from "../mod.ts";import getIntersectionNode from "./index.ts";
Deno.test("intersection-of-two-linked-lists-1", () => { const Intersected = new ListNode(8, new ListNode(4, new ListNode(5)));
const headA = new ListNode(4, new ListNode(1, Intersected)); const headB = new ListNode( 5, new ListNode(0, new ListNode(1, Intersected)), );
assertEquals(Intersected, getIntersectionNode(headA, headB));});
Deno.test("intersection-of-two-linked-lists-2", () => { const Intersected = new ListNode(2, new ListNode(4));
const headA = new ListNode( 0, new ListNode(9, new ListNode(1, Intersected)), ); const headB = new ListNode(3, Intersected);
assertEquals(Intersected, getIntersectionNode(headA, headB));});
Deno.test("intersection-of-two-linked-lists-3", () => { const Intersected = null; const headA = new ListNode(2, new ListNode(6, new ListNode(4))); const headB = new ListNode(1, new ListNode(5));
assertEquals(Intersected, getIntersectionNode(headA, headB));});
masx200_leetcode_test

Version Info

Tagged at
a year ago