Hackerrank solutions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
436 B

#!/usr/bin/python3
# https://www.hackerrank.com/challenges/halloween-party
import sys
def count_gems(str, gems):
tmp = [ False ] * 26
for c in str:
tmp[ord(c) - 97] = True
for i in range(26):
if not tmp[i]:
gems[i] = False
def main():
N = int(sys.stdin.readline())
gems = [ True ] * 26
for _ in range(N):
str = sys.stdin.readline().strip()
count_gems(str, gems)
print(sum(gems))
if __name__ == '__main__':
main()