Browse Source

Solved Gem Stones

main
Titouan Rigoudy 11 years ago
parent
commit
d178fa815c
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      gem_stones/gem_stones.py

+ 24
- 0
gem_stones/gem_stones.py View File

@ -0,0 +1,24 @@
#!/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()

Loading…
Cancel
Save