百度数据挖掘试题:求两个数列的最大重叠部分,并且依次给最大、次大、最小的重叠部分的重叠次数

1个回答

  • for i=1:1:n

    for j=i+1:1:n

    lengthnum=length(robot1(i:j));

    for k=1:1:n

    if (lengthnum+k-1<=n)&&sum(robot1(i:j)==robot2(k:lengthnum+k-1))==lengthnum

    sumcount(lengthnum)=sumcount(lengthnum)+1;

    end

    end

    end

    end