MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / Compute

Class Compute

ArraySubset.java:1–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Compute {
2 public String isSubset( long a1[], long a2[], long n, long m) {
3
4 HashSet<Long> set = new HashSet<Long>();
5
6 for(int i=0;i<n;i++)
7 {
8 set.add(a1[i]);
9 }
10
11 for(int j=0;j<m;j++)
12 {
13 if(!set.contains(a2[j])) return "No";
14 }
15 return "Yes";
16 }
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected