I am trying to check if an Array A contains all the elements of Array B and similarly Array B contains elements of Array A, the order does not matter.Some examples:A               B                Result {1}             {0}              false{0, 0, 0}       {0, 0, 0}        true{17, 4, 11}     {4, 17, 11}      trueI have written the following code:public static bool CheckEquality(int[] a, int[] b) {    return Array.TrueForAll(a, m => b.Count(z => m == z) == a.Count(z => m == z)) && a.Length == b.Length;}Both arrays contain just integers. Both arrays should strictly contain the same number of the same elements, and their lengths should be equal.Is there a better and efficient way to do this?
Check if array A contains all elements of array B and vice versa irrespective of order
c#;array