Manasa and Stones
Set
Set is an abstract data type that only stores unique elements. In C++ sets are implemented as a binary search tree and the elements can be accessed in a sorted order.
In Python sets are unordered.
In general, operation complexity in a set is as follows:
insert : O(logn)
delete : O(logn)
lookup : O(logn)
In Python sets are mathematical sets which also support set difference and set intersection.
Sets have a varient Multiset that also stores multiple values.
Set ADT can be used in computations where you are dealing with unique elements.
Related challenge for Set