Softeer - 8단 변속기 (Python)

조민수·2024년 6월 11일

Softeer

목록 보기
2/20

Lv2, ⭐⭐


문제 풀이

  • deepcopy을 통해 lst를 값 복사 해준 후, 복사한 tmp를 기준에 맞게 정렬하며 비교하는 문제
  • 매우 쉽다.
    • Softeer는 IDE가 글씨체는 예쁜데 뭔가 아쉬워
from sys import stdin
import copy
lst = list(map(int, stdin.readline().split()))

tmp = copy.deepcopy(lst)
if lst == sorted(tmp):
    print('ascending')
elif lst == sorted(tmp, reverse=True):
    print('descending')
else:
    print('mixed')
profile
Being a Modern Project Manager

0개의 댓글