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 | 31 |
Tags
- PYTHON
- 캐치카페
- github
- 데이콘
- 우분투
- 맥북
- 금융문자분석경진대회
- Kaggle
- gs25
- 파이썬
- hackerrank
- SW Expert Academy
- 편스토랑 우승상품
- 백준
- ChatGPT
- 프로그래머스
- 프로그래머스 파이썬
- dacon
- Baekjoon
- 편스토랑
- AI 경진대회
- Docker
- ubuntu
- Git
- leetcode
- 더현대서울 맛집
- 자연어처리
- 코로나19
- Real or Not? NLP with Disaster Tweets
- programmers
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 26545번 : Reverse (Python) 본문
728x90
반응형
코딩 1일 1문제! 오늘의 문제는 백준의 Reverse 입니다.
26546번: Reverse
The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will be one line with a string and two integers i and j, separated by spaces. The first int, i, is the start index of the substring to be taken
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def reverse(string, start_idx, end_idx):
return "".join([word[1] for word in enumerate(string) if int(start_idx) > word[0] or word[0] >= int(end_idx)])
if __name__ == "__main__":
for _ in range(int(input())):
string, start_idx, end_idx = input().split()
print(reverse(string=string, start_idx=start_idx, end_idx=end_idx))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 26574번 : Copier (Python) (0) | 2022.12.27 |
---|---|
[BaekJoon] 5357번 : Dedupe (Python) (0) | 2022.12.26 |
[BaekJoon] 10189번 : Hook (Python) (0) | 2022.12.22 |
[BaekJoon] 26545번 : Mathematics (Python) (0) | 2022.12.21 |
[BaekJoon] 5358번 : Football Team (Python) (0) | 2022.12.20 |
Comments