백준 20977번: JOI ソート (JOI Sort) #Python

ColorlessDia·2024년 5월 25일

algorithm/baekjoon

목록 보기
187/808
N = int(input())
S = input()

sorted_S = sorted(S, key=lambda x: (x == 'J', x == 'O', x == 'I'), reverse=True)

print(''.join(sorted_S))

0개의 댓글