-
10809 공식을 유도하지말고 외우자코테 대비 python/백준 2023. 1. 31. 11:00
https://www.acmicpc.net/problem/10809
s= input() test=[] test_s=[] cnt=0 for i in s: if i in test_s: cnt+=1 else: test_s.append(i) test.append([i,cnt]) cnt+=1 alpha=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] for j in alpha: flag=0 for k in test: if j == k[0]: print(k[1],end=" ") flag=1 if flag ==0: print(-1,end=" ")
https://gururuglasses.tistory.com/88 분의 풀이 암기하자 S = input() abc ='abcdefghijklmnopqrstuvwxyz' for i in abc: if i in S: print(S.index(i), end= ' ') else: print( -1, end =' ')
'코테 대비 python > 백준' 카테고리의 다른 글
1152 리스트로 받기 (0) 2023.01.31 2675 문자열 (0) 2023.01.31 11654 아스키코드 (0) 2023.01.31 1110 문자열+while (0) 2023.01.30 10951 try except 런타임에러 나오면 생각해보기 (0) 2023.01.30