본문 바로가기
python-algorithm

[백준] 2774

by 무적김두칠 2021. 1. 7.

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하는 방식 입니다. 

반응형

'python-algorithm' 카테고리의 다른 글

[백준] 2798  (0) 2021.01.08
[백준] 2789  (0) 2021.01.07
[백준] 2744  (0) 2021.01.07
[백준] 2743  (0) 2021.01.07
[백준] 2712  (0) 2021.01.07

댓글