#109. linearIn
linearIn
Background
Description
Given two arrays of ints sorted in increasing order, outer and inner, return true if all of the numbers in inner appear in outer. The best solution makes only a single "linear" pass of both arrays, taking advantage of the fact that both arrays are already in sorted order.
Format
Input
Output
Samples
[1 2 4 6] [2 4]
true
[1 2 4 6] [2 3 4]
false
[1 2 4 4 6] [2 4]
true
Limitation
1s, 1024KiB for each test case.