[백준]10818번 최소, 최대

Date:     Updated:

카테고리:

Problem Statement

1

Solution

N = int(input())
A = list(map(int, input().split()))
A.sort()
print(A[0], A[N-1])
  • Keypoint
    • sort()함수: 리스트를 작은 수부터 큰수까지 오름차순으로 차례대로 정리해준다
    • sort(reverse = False)가 Default값이고, 만약 reverse = True이면 내림차순으로 정렬된다.

Baekjoon 카테고리 내 다른 글 보러가기

댓글 남기기