Programming/Python & Data Structures
[Baekjoon/Python3] 10809번 알파벳 찾기
HooNeee
2020. 12. 6. 18:11
[Baekjoon/Python3] 10809번 알파벳 찾기
10809번: 알파벳 찾기
각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다. 만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출
www.acmicpc.net
string = input()
alp = list(map(chr, range(97, 123)))
res = list(map(string.find, alp)) # ~.find('~')
print(*res, sep = ' ') # * = internal