I have an LinkedHashMap that uses the values from a char array as its key adds integers 1 to the size of the char array as its values:
hmConvert = new LinkedHashMap<Character, Integer>();
for (int m = 0; m < referenceString.length; m++) {
hmConvert.put(referenceString[m], m);
}
an example of values in the char array would be:
'0', '1', '5', '3', '6', '6', '4', '4', '5', '5', '6', '0', '3', '3', '5'
When i use the get method on the LinkedHashMap it is returns the higest key back, for example:
int test = hmConvert.get(5);
System.out.println(test);
The output would be: 14
I need the output in this case to be the LOWEST value after a GIVEN input value. So if I inputted 4 as the input, the returned value would be 8.
How would I go about doing this.