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.
Thanks for the reply. For my particular case, the language is Ruby. I did read the post you linked, thus it appears that the Ruby tests must not have been updated to enforce the 'order of duplicate encountered' description rule, as the other users' Ruby solutions I reviewed were significantly less complex while performing typical duplicate handling/ordering behavior.
Which language are you talking about? In javascript there is a test with that input that only checks you return an array of length 3. But there are other tests that test the order. BTW, read this: https://www.codewars.com/kata/5558cc216a7a231ac9000022/discuss#5d16601a17c87800297a78e1
The result DOES NOT need to reflect the duplicates in order of encounter to pass the tests, despite what the description infers:
"The elements of the returned array should appear in the order when they first appeared as duplicates."
Thus for the example array: [1,2,4,4,3,3,1,5,3, '5']
If you took the description literally, the result would/should be: [4,3,1] as the 4's are duplicated before the 1's. Same for the 3's.
However, after coding a solution to satisfy this requirement, I reviewed other solutions and discovered that the order does not actually matter, in-so-far as passing the tests, and [1,4,3] is a passing/accepted result. Frustrating. HTH someone else.