title: Java - How to find if 2 arrays are duplicates of each other?
body: <p>Given 2 arrays, how can one find out quickly if they are identical by value to each other? </p>
  
  <p>For example, arr1 and arr2 are considered to be identical because they contain equal values, while arr2 and arr3 aren't</p>
  
  <pre><code>int[] arr1 = new int[]{-1, 0, 1};
  int[] arr2 = new int[] {-1, 0, 1};
  int[] arr3 = new int[] {0, -1, 1}; // not identical
  </code></pre>
  
  <p>What is the quickest way to find out? I know a for loop will work, but can you do faster, say, constant time? HashSet doesn't work, because technically arr1 and arr2 are different objects</p>
  
  <p>Edit1: what if there are N arrays, and we want to filter out the unique ones? </p>