Find the Smallest Common Number

Given three integer arrays sorted in ascending order, return the smallest number found in all three arrays.

Statement

We’re given three integer arrays, each sorted in ascending order. Return the smallest number common in all three arrays. In case no number is common, return -1.

Example

Let’s look at the three arrays below, where 66​ is the smallest number that is common in all the arrays:

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