Finding duplicate values in array. java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/9893580/how-to-find-a-duplicate-of-length-5-in-a-single-array-java">How to find a duplicate of length 5 in a single array. Java</a>  </p>
</blockquote>



<p>I am trying to see if there are any duplicates in the array.</p>

<pre><code>import java.util.Hashtable;

public class test {
    static final int COUNT = 10;

    static Hashtable&lt;String, Integer&gt; compareSet = new Hashtable&lt;String, Integer&gt;();
    static String groupInteger = "";
    static long arr[] = new long[5];
    static int st = 1;
    static int end = 56;
    static double t1;
    static double t2;

    static int ctr = 0;

    public static void main(String[] args) {
        t1 = System.currentTimeMillis();
        for (int n = 0; n &lt; COUNT; n++) {
            for (int i = 0; i &lt; arr.length; i++) {
                arr[i] = (long) ((Math.random() * (end - st + 1)) + st);

            }
            for (int i = 0; i &lt; 5; i++) {
                groupInteger += arr[i];
                if (i % 5 == 0) {
                    System.out.println();
                    if (compareSet.containsKey(groupInteger)) {
                        ctr++;
                        System.out.println("duplicate found ");
                        int currentCount = compareSet.get(groupInteger);
                        compareSet.put(groupInteger, currentCount + 1);

                    } else {
                        compareSet.put(groupInteger, 1);
                    }
                    groupInteger = "";
                }
                System.out.print(arr[i]);
            }
        }
        t2 = System.currentTimeMillis();
        System.out.println();
        System.out.println();
        System.out.println("\t" + "Total run time is " + ((t2 - t1)) + "ms");
        System.out.println(compareSet);
    }
}
</code></pre>

<p>the console:</p>

<pre><code>12  23  8   44  23
28  13  39  49  53
37  40  16  53  48
6   45  14  52  20
32  4   41  10  38
38  29  25  21  13
16  34  45  26  11
22  33  54  21  10
40  34  53  37  50
20  26  48  32  51
</code></pre>

<p>I want to be able to check if there are duplicate rows. 
I cant seem to finagle this code around to work properly.
Please let me know if you see something! Thank you</p>
