Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 맥북
- 백준
- SW Expert Academy
- hackerrank
- 프로그래머스 파이썬
- 자연어처리
- 캐치카페
- Baekjoon
- gs25
- 편스토랑 우승상품
- 더현대서울 맛집
- PYTHON
- AI 경진대회
- ChatGPT
- Docker
- Kaggle
- 편스토랑
- github
- 코로나19
- 우분투
- 데이콘
- Real or Not? NLP with Disaster Tweets
- programmers
- ubuntu
- dacon
- Git
- 파이썬
- 프로그래머스
- leetcode
- 금융문자분석경진대회
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 20528번 : 끝말잇기 (Python) 본문
728x90
반응형
코딩 1일 1문제! 오늘의 문제는 백준의 끝말잇기 입니다.
Solution
def end_to_end(num, string):
is_end_to_end = 1
if num > 0:
split_str = string.split()
compare_word = split_str[-1]
for i in range(1, num):
if split_str[i] != compare_word:
is_end_to_end = 0
break
compare_word = split_str[-1]
return is_end_to_end
if __name__ == "__main__":
input_num = int(input())
string = input()
print(end_to_end(input_num, string))
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 10822번 : 더하기 (Python) (0) | 2021.07.20 |
---|---|
[BaekJoon] 1302번 : 베스트셀러 (Python) (0) | 2021.07.19 |
[BaekJoon] 2789번 : 유학 금지 (Python) (0) | 2021.07.17 |
[BaekJoon] 4949번 : 균형잡힌 세상 (Python) (0) | 2021.07.16 |
[BaekJoon] 1871번 : 좋은 자동차 번호판 (Python) (0) | 2021.07.15 |
Comments