본문 바로가기
python-algorithm

백준 26546 Reverse

by 무적김두칠 2022. 12. 23.

https://www.acmicpc.net/problem/26546

 

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

 

1
2
3
4
5
6
7
8
9
def sol(s, i, j):
    i,j = int(i), int(j)
    answer = s[:i]+s[j:]
    return answer
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        s, i, j = input().split()
        print(sol(s, i, j))
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 26766 Serca  (0) 2022.12.24
백준 6888 Terms of Office  (0) 2022.12.23
백준 10188 Quadrilateral  (0) 2022.12.23
백준 26592 Triangle Height  (0) 2022.12.23
백준 26561 Population  (0) 2022.12.23

댓글