Let see...
I have no idea why you got twice the values you expect (Blue is 54, probably, no).
I see some issues in your code, and I fail to connect it with the result you have.
So, you get a string at column 9.
If the string is already in the map as a key, you get the previous count. You can probably thank Java 1.5's auto-unboxing in the ++count line...
And you increase the count in the map. OK.
Then you test again if the value is in the map. A bit redundant since you are in the 'else' part already. Not a real problem, unless speed (and readability) is important.
If it is not there, you put the current value of 'count' (a bit random there, no I would put a simple '1') and print the line where it have been found.
Right
Aha!
I think I found the issue.
Remember () what the
size() reference page says:
Quote:The size() function must be the first line in setup(). [...] Again, the size() method must be the first line of the code (or first item inside setup). Any code that appears before the size() command may run more than once, which can lead to confusing results.