[Solved] How to return specific int values from an array; How to make a testclass?
This could probably be shorter, but it works. public static int findMostCommonElement(int[] list) { int max = 0; for (int i : list) if (i > max) max = i; int[] newArr = new int[max]; for (int i = 0; i < max; i++) newArr[i] = 0; for (int i = 0; i < max; … Read more