[Programmers] N개의 최소공배수
Python import math def solution(arr): answer = arr[0] for i in range(1, len(arr)): answer = (answer * arr[i]) // math.gcd(answer, arr[i]) ...
Python import math def solution(arr): answer = arr[0] for i in range(1, len(arr)): answer = (answer * arr[i]) // math.gcd(answer, arr[i]) ...
Python def solution(s): arr = list(map(int, s.split(' '))) return str(min(arr)) + " " + str(max(arr))
Python def solution(n): answer = 0 for i in range(1, n + 1): sum = 0 for j in range(i, n + 1): sum += j if su...
Python def solution(array, commands): answer = [] for command in commands: temp = sorted(array[command[0] - 1:command[1]]) answer.app...
Python def solution(a, b): answer = 0 for i in range(len(a)): answer += a[i] * b[i] return answer