title: how to return equivalent Arrays
body: <p>A function  named equivalentArrays that has two array arguments and returns 1 if the two arrays contain the same values (but not necessarily in the same order), otherwise it returns 0. Note that the arrays do not have to have the same number of elements, they just have to have one of more copies of the same values.</p>
  
  <pre><code>public class Equavalenarray {
  
      public static void main(String[] args) {
  
              int  result= equivalentArrays(new int[] {}, new int[]  {});
              System.out.println(result);     
  
              result=equivalentArrays (new int [] {0,2,1,2}, new int [] {0,2,1,2,1});
              System.out.println(result);
              result=equivalentArrays (new int [] {3,1,2,0}, new int [] {0,2,1,0});
              System.out.println(result);
  
      }
  
      public static int equivalentArrays(int[ ] a1, int[ ] a2) {
          if(a1==null || a2==null) return 0;
  
          for(int i=0; i&lt;a1.length; i++) {
              for(int j=0; j&lt;a2.length; j++) {
                  if(a1[i]==a2[j] ) 
                  {
                  return 1;               
                  }
          }
  
  
      }
          return 0;
  
  }
  }
  </code></pre>