Solution: An Array as a Subset of Another Array
Let’s solve the An Array as a Subset of Another Array problem.
Statement
Given two arrays, array1
and array2
, implement a function that takes the two arrays as input and checks whether array2
is a subset of array1
.
A subset is a set containing only elements present in another set.
Constraints:
-
array1.length
-
array2.length
Access this course and 1400+ top-rated courses and projects.