Swift判断二个数组中的所有元素是否相等

2024-11-26 08:28:38
推荐回答(1个)
回答1:

public static boolean equals(long[] a, long[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; iif (a[i] != a2[i])
return false;
return true;
}