If I have the following array of strings.
String inStrings[] = {"A", "B", "C", "D", "E", "F", "G", "H", "A", "B", "C", "D", "E", "A", "B", "C", "D", "A", "B"};
And this array is later passed to the method, and I'm not sure how to do it.
static void getColdSearch(String[] inArray){
}
This method is supposed to take an array, get the lines that will be repeated at least, and then print the five least repeated lines in the output. Duplicate lines should not be next to each other, and if there are less than five lines, they should all be part of the output. For instance. if the arrailist looks like the example above, the result should look something like this.
F
G
H
E
D
How can i do this?
source
share