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.
a=int(input()) #total number of country stamps
b=set() #input taking as set because it removes duplicate values
for i in range(a):
c=input() #taking country names as inputs.
b.add(c) #appending country names to set
print(len(b)) #obtaning length of set.**
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Set .add()
You are viewing a single comment's thread. Return to all comments →
code
a=int(input()) #total number of country stamps b=set() #input taking as set because it removes duplicate values for i in range(a): c=input() #taking country names as inputs. b.add(c) #appending country names to set print(len(b)) #obtaning length of set.**