# This must be an elementary question for the pros but how do I iterate over unique

**URL:** <https://discourse.julialang.org/t/this-must-be-an-elementary-question-for-the-pros-but-how-do-i-iterate-over-unique/55579>\
**Category:** General Usage\
**Created:** [February 18, 2021, 10:05pm UTC](https://discourse.julialang.org/t/this-must-be-an-elementary-question-for-the-pros-but-how-do-i-iterate-over-unique/55579 "2021-02-18T22:05:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 18, 2021, 10:05pm UTC](https://discourse.julialang.org/t/this-must-be-an-elementary-question-for-the-pros-but-how-do-i-iterate-over-unique/55579/1 "2021-02-18T22:05:47Z")

</div>

## 

This must be an elementary question for the pros but how do I iterate over unique

This must be an elementary question for the pros but how do I iterate over unique triplets. E.g. 1:5 triplets would give me (1,1,1), (1,1,2), … (1,2,2), (1,2,3) … but not (1,2,1) because that combination is already covered by (1,1,2)?

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_ , or pinging the poster here on Discourse so they can _follow this thread_ .  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1613685924174500?thread_ts=1613685924.174500&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [February 18, 2021, 10:21pm UTC](https://discourse.julialang.org/t/this-must-be-an-elementary-question-for-the-pros-but-how-do-i-iterate-over-unique/55579/2 "2021-02-18T22:21:23Z")

</div>

You can do `unique(Set, x)` where `x` is your iterator of tuples.
