int[] m1 = new int[]{1, 2, 3, 4, }; int[] m2 = new int[]{1, 2, 3, 4, 5, 6, };
It is necessary to check whether the m2
array contains all the elements of the m1
array
I thought of this solution:
private Boolean checkRun(int[] a, int[] b) { List<Integer> list_A = new ArrayList<Integer>(); for (int index = 0; index < a.length; index++) { list_A.add(a[index]); } Boolean ret = true; for(int i = 0; i < b.length; i++) { if(list_A.contains(b[i])) { ret = true; } else { // не содержит что то ret = false; } } return ret; }
return ret;
from the end and move it underret = false;
? Just IDE swears, is it possible to do so? - St. Ivan