1
2
3
4
5
6
7
|
import sys
for _ in range(int(sys.stdin.readline())):
tmp=[0]*10
s=sys.stdin.readline()
for i in range(len(s)-1):
tmp[ int (s[i])]=1
print(sum(tmp))
|
cs |
tmp라는 list를 만들고 입력받는 X 를 자리별로 쪼개서 check하는 방식 입니다.
반응형
댓글