Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Your problem is below this line:
Without the input too, there is no much that we can do to see if there is a problem or not.
Nothing broken... Please before posting issues look at the top of the page to see how many people passed the kata (6435 in Java; your language I suppose). If there were errors chances are somebody would have seen that before you:-)
Language?
This comment is hidden because it contains spoiler information about the solution
Please, don't spoil the kata. Mark your post as having spoiler content next time.
This comment is hidden because it contains spoiler information about the solution
Your problem occurs if the unique value is the last value in the array. If that happens, your function
getResult(occurrence, null)
is called. In that case, you are creating a Listsurvivor
and populating it with every key that occurs in in your keylist1
time, which will be all of them. Keys naturally appear in HashMaps only once. The test that you are failing, the array is[8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 7.0]
. Right before you return your value,survivor
is[8.0, 7.0]
. I think what you wanted to do was get the key inoccurrence
where the value is1
, however, you never actually update any key inoccurrence
to have a value of more than1
at any time.