package ru.matevosyan;

/**
 * Created BiggerRepeatValue fo finding bigger repeating number in array.
 * Created on 25.01.2017.
 * @since 1.0
 * @author Matevosyan Vardan
 * @version 1.0
 */

public class BiggerRepeatValue {

    /**
     * Create to find bigger repeating value.
     * @param intNumbers array with which we find bigger number
     * @return <code>maxCount</code>
     */

    public int findRepeatValues(int[] intNumbers) {
        int countFor = 1;
        int maxCount = 0;
        int number = 0;

        for (int i = 0; i < intNumbers.length - 1; i++) {

            if (intNumbers[i] == intNumbers[i + 1]) {
                countFor++;
                if (maxCount < countFor) {
                    maxCount = countFor;
                    number = intNumbers[i];
                }

            } else {
                countFor = 1;
            }
        }
        System.out.println("Number" + number + "repeat" + maxCount + "times");
        return maxCount;
    }
}

@@ -450,33 +450,33 @@
  int countFor = 
-1
+0
 ;%0A        int ma
@@ -848,17 +848,17 @@
 ntFor = 
-1
+0
 ;%0A      

change countFor = 1 to 0