Description
Given two arrays of numbers find the longest prefix from any two item in the arrays :: use a trie for one list, then test each number in the second against it.
Runtime
O(n)
Pseudocode
t = trie(arr)
maximum = 0
for number in arr2:
maximum max(t.longest(number), maximum)
return maximum