also supposing the two array sizes are equal. n=n2