Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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.