careercup/CtCI-6th-Edition-Python

Chapter 2 Question 7 Test Case

erikyangs opened this issue · 1 comments

Noticed the question didn't have any tests. Hope this helps!

shared = LinkedList()
shared.add_multiple([1,2,3,4])

a = LinkedList([10,11,12,13,14,15])
b = LinkedList([20,21,22])

a.tail.next = shared.head
a.tail = shared.tail
b.tail.next = shared.head
b.tail = shared.tail

# should be 1
print(intersection(a,b))