강의

멘토링

커뮤니티

Inflearn Community Q&A

rhgustmd57624's profile image
rhgustmd57624

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

10. Inverse sequence (greedy)

이렇게 풀어도 되나요?

Written on

·

222

0

N = int(input())

a = list(map(int,input().split()))

ra = []

i = N

while i>0:

    ra.insert(a[i-1],i)

    i -= 1

for x in ra:

    print(x,end=' ')

입력받은 역수열의 마지막 index 부터 접근하여 차례로 해당 index에 삽입했습니다.

python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

네. 잘하셨습니다.

rhgustmd57624's profile image
rhgustmd57624

asked

Ask a question