C#: Find Whether an Array is a Subset of Another Array

Level : Intermediate
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:15:00

Lab Details

Difficulty Level: EASY

Problem Statement:

Given two arrays: arr1[0..m-1] and arr2[0..n-1]. Find whether arr2[] is a subset of arr1[] or not. Both arrays are not sorted.

Input:

arr[] = { 19, 2, 42, 54, 5, 81} and arr[] = {19, 5, 2, 81}

Output:

arr2[] is the subset of arr1[]


Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this