public static boolean judgeSame(int[] arr, int[] targetArr) {
int[] midArr = new int[targetArr.length];
for (int index = 0; index < midArr.length; index++) {
midArr[index] = targetArr[index];
}
int count = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr.length; j++) {
if (arr[i] == midArr[j]) {
count++;
midArr[j] = -1;
}
}
}
if (count == arr.length) {
return true;
} else {
return false;
}
} |
|