Redirecting to
NADOS

Maximum Length Of Repeated Subarray

1. You are given two arrays of integers arr1 and arr2.
2. You have to find the maximum length of subarray that appears in both the given arrays.
Input Format
A number N 
a1
a2.. N numbers
A number M
b1
b2.. M numbers
Output Format
An integer representing the maximum length of repeated subarray.
Question Video
Constraints
1 <= N,M <= 10^4
0 <= a[i], b[i] <= 10^3
Sample Input
5
5 4 3 2 1
6
7 8 4 3 2 5
Sample Output
3


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name