Can anyone write a code for this?
Searching a set of Integers
You are given two sets of integers. S1 and S2. The size of S1 is less than sizeof S2, i.e. the number of integers in S1 is less than the number of integers in S2.
Neither S1, not S2 can be an empty set.
You have to find out whether the sequence of integers of S1 is there in S2.
e.g. S1 = { 1, 5, 6 }, and S2 = { 4, 7, 9, 1, 5, 6 }.
Here, you have found the S1 in S2 subset.
S1 = { 1, 9 }, and S2 = {5, 8, 9 , 1 }
Here, S1 is not found in S2
S1 = { 2, 5 }, and S2 = {6, 2, 5, 7, 2, 5, 1 }
Here, S1 is found in S2, twice. You need to return all the instances.
You can do this in C/C++
