title: Comparing 2D arrays of strings
body: <p>I have a method which generates a 2D array of strings, then places them in a <code>ArrayList</code>. I am trying to write a method which take a new 2D array and check it against those already in the array for duplication. This is what I have so far, it should return <code>true</code> for a new solution but it returns <code>false</code> every time. The calling method prints the arrays out and I can see that they are not the same.</p>
  
  <pre><code>public static boolean tester(String[][] b, ArrayList&lt;String[][]&gt; s)
  {
      if (s.size() == 1) return true;
      boolean n = true;
      int count;
      int size = b.length * b[0].length;
  
      for (int i = 0; n &amp;&amp; i &lt; s.size() -1; i ++)
  
      {   
          count = 0;
          for (int j = 0; j &lt; s.get(i).length; j ++)
              for (int k = 0; k &lt; s.get(i)[0].length; k ++)
                  if (s.get(i)[j][k].equals(b[j][k])) count ++;
                      if (count == size) n = false;
  
      }
  
      return n;
  }
  </code></pre>