info@onlinelearningcenter.in (+91) 7 999 01 02 03 Get started with 45 Hours of Free course right now 

Find whether an array is subset of another array

Dhamo Daran
2 Posts
Input: 
arr1[] = {11, 1, 13, 21, 3, 7}
arr2[] = {11, 3, 7, 1} 

Output: arr2[] is a subset of arr1[]

Input: 
arr1[] = {1, 2, 3, 4, 5, 6}
arr2[] = {1, 2, 4} 

Output: arr2[] is a subset of arr1[]

Input:
arr1[] = {10, 5, 2, 23, 19}
arr2[] = {19, 5, 3}

Output: arr2[] is not a subset of arr1[] 

 

 

Published By : Dhamo Daran
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments