Is it possible to write a function that compares a list of strings or numbers, or both, and determines which items in the list are uniques?

could someone provide sample code of how that would be done using any of the main languages.

  • in solidity I guess ?
    – euri10
    Commented Mar 3, 2016 at 8:46
  • ah yes. i'm also looking for an code example of how to do this of going through an array and checking all the items and returning those which are uniques or filtering out those which have duplicates. Commented Mar 4, 2016 at 13:45

1 Answer 1


You can implement a mapping wrapper, that will have "contains" method.

Something like here : https://github.com/ethereum/dapp-bin/blob/master/library/iterable_mapping.sol

  • Please consider adding more information to your post as links may break in the future.
    – q9f
    Commented Mar 5, 2016 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.