문제 바로가기> 백준 15969번: 행복
정렬을 통해 쉽게 문제를 해결할 수 있다.
def solution(): import sys input = sys.stdin.readline n = int(input()) score = list(map(int, input().split())) score.sort() print(score[n-1]-score[0]) solution()