인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

juwhan10048065's profile image
juwhan10048065

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

2. Kth number

질문드립니다.

Written on

·

149

0

섹션 2 k번째 수 문제에서

import sys
T=int(input())

for t in range (T):
    n,s,e,k= map(int,sys.stdin.readline().split())
    A=list(map(int,sys.stdin.readline().split()))

    for i in range (s-1,e-1):
        if A[i]>A[i+1]:
            rem=A[i]
            A[i]=A[i+1]
            A[i+1]=rem

    print(A[k+s-2])
           

 

 

 

저는 이런식으로 코드를 짰는데 효율성면에서 많이 떨어지나요?

 

python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

일단 채점을 해보세요. 오답으로 채점됩니다.

juwhan10048065's profile image
juwhan10048065

asked

Ask a question