using System;
public class Program
{
public static void Main()
int[] source ={1,2,3,4,3,4,5,6,7,8};
int[] target ={3,4,5,6};
int j=0;
int index=0;
bool match= false;
for(int i=0;i< source.Length && j< target.Length;)
if(source[i]!= target[j])
if(match==true)
j=0;
index=i;
}
else
i++;
match=true;
j++;
if(j==target.Length)
Console.WriteLine(index);
Console.WriteLine(-1);