Answer:
Sew explaination foe code
Explanation:
import java.lang.*;
import java.util.*;
import java.io.*;
class Main
{
public static Boolean checkSubset(int[] list1, int[] list2)
{
int l = list2.length;
for(int i = 0; i<list1.length-l; i++)
{
Boolean flag = true;
for(int j = 0; j<list2.length; j++)
{
if(list1[i+j] != list2[j])
{
flag = false;
break;
}
}
if(flag) return true;
}
return false;
}
public static void main(String args[])
{
int[] l1 = {1,6,2,1,4,1,2,1,8};
int[] l2 = {1,2,2};
System.out.println(checkSubset(l1,l2));
}
}