We need to check if 2 arrays are similar or not. The elements can be duplicate as well. For example A = {2,3,4,5,6,6} and B = {3,6,2,4,6,5} are similar.
I have a nai
i just want to mention that u don't have to run your algorithm(whether it has a complexity of o(n*m) or max(n,m)) for all input combinations.Run your algorithm only if xor of all the elements of both arrays is equal to zero. i.e a[0] xor a[1] xor...b[0] xor...b[n]=0. otherwise u can surely say that array A and B is not equal.