[Programmers] N개의 최소공배수

[Programmers] N개의 최소공배수

import java.util.*; class Solution { public int solution(int[] arr) { Arrays.sort(arr); int num = 0; int cnt = 1; boolean loop = true; // while문 종료시킬때 쓰기위해서 선언 while(loop) { num = arr[arr.length-1] * cnt; // 배열에서 제일 큰 수의 배수로 num 선언 for(int i=0; i

from http://do-hyeon.tistory.com/243 by ccl(A) rewrite - 2021-12-01 03:28:15