11 Tue

K๋ฒˆ์งธ์ˆ˜

'''
https://programmers.co.kr/learn/courses/30/lessons/42748
K๋ฒˆ์งธ์ˆ˜
1. ์ฃผ์–ด์ง„ ๋ฐฐ์—ด์˜ i~j ์ธ๋ฑ์Šค์˜ ๋ถ€๋ถ„ ๋ฐฐ์—ด์„ ์ •๋ ฌ ํ›„ k๋ฒˆ์งธ ๊ฐ’ ์ฐพ๊ธฐ
2. ๋ฌธ์ œ ๊ทธ๋Œ€๋กœ ํ’€์ด
'''
def solution(array, commands):
    return [ sorted(array[ a - 1 : b ])[ c - 1 ] for (a, b, c) in commands ]
'''
'''

Last updated

Was this helpful?