https://leetcode-cn.com/problems/maximum-length-of-repeated-subarray/description/
动态规划 维护当前存在的最长重复子数组
public int findLength(int[] A, int[] B)
{
int res=0;
int temp[][]=new int[A.length+1][B.length+1];
for(int i=1;i<=A.length;i++)
{
for(int j=1;j<=B.length;j++)
{
if(A[i-1]==B[j-1])
{
temp[i][j]=temp[i-1][j-1]+1;
res=Math.max(temp[i][j],res);
}
}
}
return res;
}