Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- DP
- 오류
- C#
- 백준
- UE5
- dfs
- guide
- 문제풀이
- w3school
- Unreal Engine 5
- Tutorial
- Algorithm
- Programming
- dynamic
- 시작해요 언리얼 2022
- 재귀
- 기초
- c++
- parameter
- Basic
- python
- String
- Unity
- W3Schools
- github
- loop
- 프로그래밍
- Class
- 파이썬
- Material
Archives
- Today
- Total
행복한 개구리
백준21.11.25. 2941번 - 크로아티아 알파벳 본문

croaticAlphabet = ["c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="]
input = input()
for element in croaticAlphabet:
input = input.replace(element, "*")
print(len(input))
replace메서드는 문자열의 첫번째 매개변수와 일치하는 요소(element)를 두번째 매개변수(*)로 대체하는 메서드이다.
따라서 알파벳의 수만큼 *이 생성되며 반복문을 마쳐 *로 모두 대체된 input의 문자열 길이가 곧 크로아티아 알파벳의 갯수이다.
'Algorithm > BaekJoon' 카테고리의 다른 글
백준 21.11.25. 1712번 - 손익분기점 (0) | 2021.11.25 |
---|---|
백준 21.11.25. 1316 - 그룹 단어 체커 (0) | 2021.11.25 |
백준 21.10.27. 5622 - 다이얼 (0) | 2021.10.27 |
백준 21.10.26. 2908 - 상수 (0) | 2021.10.26 |
백준 21.10.26. 1152 - 단어의 개수 (0) | 2021.10.26 |