728x90
반응형
문제 출처: https://school.programmers.co.kr/learn/courses/30/lessons/12953
풀이:
def solution(arr):
arr.sort()
max = arr[-1]
res = arr[-1]
while True:
for i in range(len(arr) - 1):
if res % arr[i] != 0:
break
else:
return res
res += max
print(solution([2,6,8,14]))
반응형
댓글