2

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 Mar 3 '16 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. – Dominik Zynis Mar 4 '16 at 13:45
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. – Waqar Lim Mar 5 '16 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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