FastPrepFastPrep
Problem Brief

Find Length of Longest Common Prefix

OA
See Uber online assessment and hiring insights

Given two arrays of strictly integers, arr1 and arr2, find the length of the longest common prefix of any pair of numbers from the two arrays.

1Example 1

Input
arr1 = [123, 4, 5, 955], arr2 = [12345, 63, 95, 2]
Output
3
Explanation
n/a 🥲

Constraints

Limits and guarantees your solution can rely on.

n/a 🥹
public int findLengthOfLongestCommonPrefix(int[] arr1, int[] arr2) {
  // write your code here (pps:) you may want to refer to lc 3043)
}
Input

arr1

[123, 4, 5, 955]

arr2

[12345, 63, 95, 2]

Output

3

Sign in to submit your solution.