We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Set .add()
- Discussions
Set .add()
Set .add()
Sort by
recency
|
962 Discussions
|
Please Login in order to post a comment
This is as simple as I could make it:
For Python3
import sys
num_stamps = int(sys.stdin.readline()) stamps = {sys.stdin.readline().rstrip() for _ in range(num_stamps)} sys.stdout.write(str(len(stamps)))
n =int(input()) s=set() for i in range(n): t=input()
s.add(t) print(len(s))