Challenge: Sorted Array Multiple Search

Solve the Sorted Array Multiple Search Problem.

We'll cover the following

Problem


Sorted Array Multiple Search Problem

Search multiple keys in a sorted sequence of keys.

Input: A sorted array K=[k0,,kn1]K = [k_{0},\ldots, k_{n-1}] of nn distinct integers and an array QQ =q0,,qm1= {q_{0},\ldots,q_{m-1}} of mm integers.

Output: For each qiq_{i}, check whether it occurs in KK.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.